Reference material for Introduction to Cloud Computing using Microsoft Azure.
This document contains two parts:
Host a static website using Azure storage
If you don’t have an Azure subscription, create a free account before you begin.
Note: If you are a student, you can get $100 of credit to get started and sign up without a credit card here by providing your school email address.
Create a GPv2 storage account
Using the Azure Portal, click on “Static website (preview)” under “Settings” in the left navigation bar.
Click “Enabled” and enter the name of the index document and (optionally) the custom error document path.
Upload your web assets to the “$web” container that was created as a part of static website enablement.
Make sure to include an index document with the name you configured. In this example, the document’s name is “index.html”.
Note: The document name is case sensitive and therefore needs to match the name of the file in storage exactly.
Finally, navigate to your web endpoint to test your website.
Create a Linux Virtual Machine using Azure Portal
Create SSH key pair: Note: If you have an existing SSH key pair, this step can be skipped.
To create an SSH key pair and log into Linux VMs, run the following command from a Bash shell and follow the on-screen directions.
Press enter multiple times for defaults.
ssh-keygen -t rsa -b 2048
Copy the contents of the generated public key file (
cat ~/.ssh/id_rsa.pub) to the clipboard.
Log in to the Azure portal.
- Create virtual machine:
- Create a resource
- Ubuntu Server 16.04 LTS
Under Basics tab, select appropriate Subscription and Resource group.
Under Instance Details, type myVM for the Virtual machine name and choose Southeast Asia for your Region. Leave the other defaults. You can use Change size to change the hardware configuration for your VM.
Under Administrator Account, select SSH public key, type your user name (local), then paste the public key you copied earlier into the text box. Remove any leading or trailing white space in your public key.
Under Inbound port rules > Public inbound ports, choose Allow selected ports and then select SSH (22) and HTTP (80) from the drop-down.
Leave the remaining defaults and then select the Review + create button at the bottom of the page.
Connect to virtual machine by creating an SSH connection with the VM:
Select the Connect button on the overview page for your VM.
In the Connect to virtual machine page, keep the default options to connect by DNS name over port 22. In Login using VM local account a connection command is shown. Click the button to copy the command. The following example shows what the SSH connection command looks like:
Paste the SSH connection command into a shell, such as Bash on Ubuntu to create the connection.
Clean up resources:
When no longer needed, you can delete the resource group, virtual machine, and all related resources. To do so, select the resource group for the virtual machine, select Delete, then confirm the name of the resource group to delete.