Lab: Exploring Cloud Computing with Azure Virtual Machines
Describe cloud computing
Lab: Exploring Cloud Computing with Azure Virtual Machines
This lab provides a hands-on introduction to the core concepts of cloud computing as defined in the AZ-900 curriculum. By deploying a Virtual Machine (VM), you will experience on-demand self-service, the consumption-based model, and the Shared Responsibility Model in action.
[!WARNING] Remember to run the teardown commands at the end to avoid ongoing charges against your Azure credit.
Prerequisites
- An active Azure Subscription (Free Trial, Student, or Pay-As-You-Go).
- A modern web browser.
- (Optional) Azure CLI installed locally, though you can use the Azure Cloud Shell in the browser.
- Basic understanding of what a server is.
Learning Objectives
- Provision a cloud resource using the Infrastructure as a Service (IaaS) model.
- Verify the characteristics of cloud computing: on-demand provisioning and resource pooling.
- Identify which parts of the deployed infrastructure fall under your responsibility vs. Microsoft's.
Architecture Overview
This lab involves deploying a single virtual machine within a logical container called a Resource Group. The following diagram illustrates the components being created:
Step-by-Step Instructions
Step 1: Create a Resource Group
A Resource Group is a logical container for Azure resources. This is the first step in organizing your cloud footprint.
CLI Method:
az group create --name brainybee-lab-rg --location eastus▶Console alternative
- Search for Resource groups in the top search bar.
- Click + Create.
- Subscription: Select your active subscription.
- Resource group:
brainybee-lab-rg. - Region:
(US) East US. - Click Review + create, then Create.
Step 2: Deploy a Linux Virtual Machine
We will deploy a small Ubuntu VM. This demonstrates Infrastructure as a Service (IaaS).
CLI Method:
az vm create \
--resource-group brainybee-lab-rg \
--name lab-vm \
--image Ubuntu2204 \
--admin-username azureuser \
--generate-ssh-keys \
--size Standard_B1s[!TIP] The
Standard_B1ssize is eligible for the Azure Free Tier in many regions.
▶Console alternative
- Search for Virtual machines.
- Click Create > Azure virtual machine.
- Resource Group: Select
brainybee-lab-rg. - VM Name:
lab-vm. - Image:
Ubuntu Server 22.04 LTS. - Size:
Standard_B1s. - Authentication type: SSH public key.
- Username:
azureuser. - Click Review + create, then Create. (Download the private key if prompted).
Step 3: Observe Cloud Characteristics
While the VM is deploying, note the speed. In a traditional on-premises environment, acquiring a server would take weeks. Here, it takes under 2 minutes. This is Agility.
Checkpoints
| Checkpoint | Action | Expected Result |
|---|---|---|
| Deployment Status | Check the "Notifications" (bell icon) in the portal. | Status should be "Deployment succeeded". |
| Resource Check | Run az resource list -g brainybee-lab-rg --output table. | You should see 6+ resources (VM, Disk, Network Interface, etc.). |
| Connectivity | Try to ping the Public IP address (if ICMP is enabled). | The IP address is assigned and reachable via the internet. |
Concept Review: Shared Responsibility
Now that the VM is running, consider the responsibility boundaries:
- Microsoft's Job: Ensuring the physical hardware in East US doesn't fail and the power stays on.
- Your Job: Patching the Ubuntu OS and securing the
azureuseraccount.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
QuotaExceeded | Your subscription has a limit on the number of CPU cores. | Change the Size to a smaller one (e.g., B1ls) or change regions. |
AuthorizationFailed | You don't have permission to create resources. | Ensure you are using a Subscription where you have 'Owner' or 'Contributor' roles. |
SshKeyGenError | (CLI) Issue generating local keys. | Use the Azure Portal method which manages keys for you. |
Clean-Up / Teardown
To avoid costs, delete the entire resource group. This removes the VM, the disk, and the network settings simultaneously.
CLI Method:
az group delete --name brainybee-lab-rg --yes --no-wait[!IMPORTANT] Deleting a Resource Group is irreversible. Ensure you have no other important data in
brainybee-lab-rgbefore running this.
Cost Estimate
- Standard_B1s VM: ~$0.01 per hour.
- Storage (P6 Disk): ~$5.00 per month (pro-rated to minutes).
- Total for 15-min Lab: Less than $0.05 (Free if using Azure Free Trial credits).