Microsoft Azure — Labs¶
Hands-on labs that build up a small piece of Azure infrastructure incrementally: an SSH key pair, a VM, a couple of Virtual Networks, a subnet, a public IP, and then wiring a managed disk, a NIC, and a public IP onto existing VMs. Each lab was done through the Azure Portal.
Note
Lab numbering follows the original source material, which jumps from Lab 2 to Lab 4 — Lab 3 doesn't exist in the source notes, so it's skipped here rather than invented.
Lab 1 — SSH key pair¶
Goal: Create an SSH key pair named datacenter-kp, of type rsa, for authenticating into VMs.
- In the Azure Portal, search for SSH key and open the SSH keys service, then select Create.
- Choose the resource group, set the key pair name to
datacenter-kp, and set the key pair type to RSA. - Review the settings to confirm they validate.
- Create the key pair — Azure generates the key and it appears in the SSH keys list.
Tip
An SSH key pair is created up front so it's ready to attach when a VM is provisioned — Azure VMs are commonly set up for key-based SSH login instead of a password.
Lab 2 — Create a virtual machine¶
Goal: Create an Azure VM named devops-vm and confirm SSH access to it.
Requirements:
- Use the existing resource group.
- VM name
devops-vm, region West US. - Image: Ubuntu 22.04 LTS.
- Size: Standard_B1s.
- A default Network Security Group (NSG) allowing inbound SSH (port 22).
- A 30 GB Standard HDD data disk.
- All other settings left at their defaults.
Steps:
- Search for Virtual machines in the Azure Portal and select Create.
- Select the resource group, name the VM
devops-vm, set the region to West US, choose the Ubuntu 22.04 LTS image, and set the size to Standard_B1s. - Configure the disk: 30 GB, Standard HDD.
- Under networking, allow inbound port 22 (SSH) so the VM gets a default NSG rule permitting SSH.
- Review and validate the configuration.
- Create the VM, then confirm it can be reached — connect to it over SSH from a Windows machine.
Lab 4 — Create a VNet¶
Goal: Create a Virtual Network named datacenter-vnet in East US, with any IPv4 CIDR block.
- Search for Virtual network in the Azure Portal and select Create.
- Choose the resource group, name the VNet
datacenter-vnet, and set the region to East US. - Accept the default IPv4 address space, since this lab doesn't require a specific CIDR block.
- Validate the configuration and create the VNet.
See Virtual Networks for why this step matters — a VNet is the private network foundation everything else (VMs, subnets, NSGs) gets placed into.
Lab 5 — Create a VNet with a specific IPv4 CIDR¶
Goal: Create a Virtual Network named datacenter-vnet in East US, this time with a specific 192.168.0.0/24 IPv4 CIDR block, since later labs provision different services under different VNets.
- Search for Virtual network in the Azure Portal and select Create.
- Choose the resource group, name the VNet
datacenter-vnet, and set the region to East US. - Set the IPv4 address space explicitly to
192.168.0.0/24. - Validate the configuration and create the VNet.
Lab 6 — Create a subnet in a VNet¶
Goal: Create a Virtual Network named xfusion-vnet in East US with an IPv4 address range of 10.0.0.0/16, and one subnet named xfusion-subnet inside it.
- Search for Virtual network in the Azure Portal and select Create.
- Choose the resource group, name the VNet
xfusion-vnet, set the region to East US, and set the address space to10.0.0.0/16. - On the IP addresses step, add a subnet named
xfusion-subnetwithin that address space. - Deploy — the VNet and its subnet deploy successfully.
Lab 7 — Create a public IP address¶
Goal: Allocate a Public IP address named devops-pip.
- Search for Public IP addresses in the Azure Portal and select Create.
- Choose the resource group and region, and set the name to
devops-pip. - Create the resource.
Note
A public IP address is a standalone resource in Azure — it isn't attached to a VM automatically. See Lab 10 for attaching one to a VM's network interface.
Lab 8 — Attach a managed disk to a VM¶
Goal: Attach an existing managed disk, xfusion-disk, to an existing VM, xfusion-vm (East US), as a data disk.
- Search for Virtual machines, and open the existing VM
xfusion-vm. - Go to the VM's Disks section.
- Use the option to attach an existing disk, and select
xfusion-disk. - Confirm the disk shows as attached to
xfusion-vm.
Warning
Make sure the VM has finished initializing before attaching the disk — the task required VM initialization to be complete before this step is submitted.
Lab 9 — Attach a NIC to a VM¶
Goal: Attach an existing network interface (NIC), datacenter-nic, to an existing VM, datacenter-vm (West US).
- Search for Virtual machines, and open the existing VM
datacenter-vm. - Attach the existing NIC
datacenter-nicto the VM. - Confirm the NIC's status shows as attached before considering the task complete.
Lab 10 — Attach a public IP to a VM¶
Goal: Attach an existing public IP, xfusion-pip, to the network interface of an existing VM, xfusion-vm-pip.
- Locate the existing VM
xfusion-vm-pipand its network interface. - Attach the public IP
xfusion-pipto that network interface's IP configuration. - Confirm the VM is properly assigned the public IP.
Tip
This is the same pattern as Lab 7 + Lab 9 combined: the public IP and the NIC are both created/attached as separate resources, then joined together on the VM's network interface.