Azure Virtual Machine (VM)
What it is
An Azure Virtual Machine is an emulated computer running in Microsoft’s datacenter — Infrastructure as a Service (IaaS). You pick an OS image (Windows or Linux), a size (CPU/RAM), one or more disks, networking, and authentication. You get full control of the guest OS, which is the defining trait of IaaS versus PaaS.
Why it exists
Some workloads need a real OS you can install anything on, tune, patch, and manage — existing on-premises apps, custom agents, licensed software. VMs give you that control without buying or racking hardware. You pay per second/hour for what you run.
Key ideas
- Compute model: vCPU + RAM are the unit of compute; pick a size/family from VM sizes.
- Storage: OS disk + optional data disks, typically managed disks. Boot from image or custom/generalized image.
- Networking: every VM has a virtual NIC attached to a virtual network (VNet) subnet; a network interface + public IP + network security group govern traffic.
- Auth: by SSH keys / username+password (Linux), or password / Microsoft Entra auth (Windows). Secrets protected with Azure Key Vault.
- Availability: plan for resilience with availability sets and availability zones.
- Scale: Virtual Machine Scale Sets run many identical VMs behind a load balancer.
- Management extensions: VM extensions (e.g. Custom Script Extension) run setup inside the guest.
How it fits (diagram)
Exam notes
- Before creating a VM, decide: resource group, size, storage (disk type/SKU, ephemeral OS disk option), networking/subnet, and availability options (region/Zones vs availability set vs none).
- VMs incur cost even when stopped (allocated) — deallocate (
az vm deallocate) stops billing while retaining disks; delete removes them. - Creation paths: Portal, Azure CLI, PowerShell, Bicep/ARM templates, Azure Quickstart templates.
- Redeploy a VM (
az vm redeploy) to a new Azure host to recover from host-level issues.
Related
Path MOC · vm-sizes · managed-disks · vm-snapshot · availability-set · availability-zones · virtual-machine-scale-set · azure-vm-extension · azure-cli · bicep
📘 Source: Microsoft Learn — Azure Vm