Azure 9: Virtual Machines
easy⏱ 5 mincourseazure
Azure VM Fundamentals
An Azure VM requires: a resource group, VM size (CPU/RAM — e.g., Standard_B2s), an OS image (Ubuntu, Windows Server), a VNet with subnet, and a NIC. VM families: B-series (burstable), D-series (general purpose), E-series (memory-optimized), F-series (compute), N-series (GPU).
// Create a VM with Azure CLI
az vm create \
--resource-group rg-compute --name vm-web-01 \
--image Ubuntu2204 --size Standard_B2s \
--admin-username azureuser --generate-ssh-keys
Build a VM provisioner
Create a VMProvisioner class with a fluent API to set name, size, image, and networking. Add validate() and estimateMonthlyCost(). Log the result.
Quiz: VM SLA
What SLA for a single VM with Premium SSD? 99.9%. For 99.95%, deploy 2+ VMs in an Availability Set. For 99.99%, use Availability Zones.