Azure Virtual Machines
😟 THE PROBLEM
The server needed next week will take a month to buy and install.
😊 THE SOLUTION
Create an Azure virtual machine in minutes.
- Weeks waiting for hardware✓ A VM is ready in minutes
- Old server failing✓ Microsoft runs the physical host
- Paying while it is idle✓ Deallocate it to stop compute charges
Quick answer
Azure Virtual Machines are IaaS computers in the cloud. You pick an operating system image and a size (CPU and memory), and Azure runs it on its hardware. A VM needs supporting resources: a disk, a network interface in a virtual network, and optionally a public IP address and a network security group. You manage the OS, software and patches.
Exam objective: 2.2.2 Describe virtual machine options, including Azure virtual machines, Azure Virtual Machine Scale Sets, availability sets, and Azure Virtual Desktop. 2.2.3 Describe the resources required for virtual machines. (Skills measured as of July 20, 2026)
Start with a question
How do you get a new server running in minutes, without buying one?
You create an Azure virtual machine: pick an operating system, pick a size, click create.
Explain it like I’m 10
The technical explanation
When you create a VM, you choose:
| Choice | Examples |
|---|---|
| Image (operating system) | Ubuntu Server, Windows Server, Red Hat |
| Size | Standard_B1s (1 vCPU, 1 GiB) up to very large memory and GPU sizes |
| Region and availability | A region, and optionally an availability zone or availability set |
| Networking | Virtual network, subnet, public IP, inbound ports |
Resources a VM needs
-
1 Virtual machine
The compute: vCPU and memory.
-
2 OS disk
A managed disk holding the operating system.
-
3 Network interface
Connects the VM to a subnet.
-
4 Virtual network
Your private network in Azure.
-
5 Public IP + NSG
Optional: internet access and firewall rules.
Real-world business scenario
An insurance company
- The problem
- A claims application only runs on Windows Server with a vendor agent, and its on-premises hardware is end-of-life.
- What they used
- Migrated to Azure VMs in two availability zones behind a load balancer, with Azure Backup.
- Why that choice
- VMs keep full OS control for the vendor software while removing hardware ownership.
- The result
- No code changes, better availability, and hardware costs eliminated.
When to use it and when not to
✓ Use it when…
- Lift-and-shift migrations.
- Software that needs full OS control.
- Specialised sizes such as GPUs.
✕ Think twice when…
- Simple web apps, where App Service is easier.
- Short event-driven tasks, where Functions is cheaper.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What is an Azure virtual machine and when would you use one?
Model answer
It is a computer in the cloud that I control completely, including the operating system. I would use one for lift-and-shift migrations, custom or legacy software, or when I need full control of the environment.
Interviewer follows up
Which resources are created with a VM?
You
At least an OS disk, a network interface and a virtual network with a subnet. Usually also a public IP address and a network security group.
Intermediate What is the difference between stopping and deallocating a VM?
Model answer
Stopping from inside the OS powers it off but keeps the hardware allocated, so compute billing continues. Deallocating, by using Stop in the portal or az vm deallocate, releases the hardware and stops compute charges. Disks still incur storage costs either way.
Experienced developer How do you make a VM-based workload production-ready?
Model answer
Run at least two instances across availability zones or an availability set behind a load balancer, use managed disks with backup, automate builds with images and infrastructure as code, patch with Azure Update Manager, close management ports and use Azure Bastion, enable Defender for Servers, and right-size with reservations or a savings plan for steady load.
Test yourself with exercises
3 original practice questions in the AZ-900 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Quick revision
Key points
- VMs are IaaS. You manage the OS and everything on it.
- Choose an image (OS) and a size (CPU/RAM).
- A VM needs a disk, NIC and virtual network; often a public IP and NSG too.
- Deallocate to stop compute charges; disks still cost money.
- Use multiple VMs across zones or availability sets for high availability.
Important terminology
- VM size
- The amount of vCPU, memory and other capacity, such as Standard_B1s or Standard_D4s_v5.
- Image
- The template the VM starts from, such as Ubuntu Server or Windows Server.
- Managed disk
- Block storage attached to a VM for its OS and data.
- Network interface (NIC)
- Connects a VM to a virtual network subnet.
- Deallocated
- A stopped VM whose hardware is released, so compute billing stops.
Common mistakes
- Assuming a VM shut down from inside the OS stops billing.
- Opening RDP or SSH to the whole internet.
Exam tips
- "Resources required for a VM": disk, NIC, virtual network (subnet); optional public IP and NSG.
Five quick revision questions
-
1.Which cloud service type is an Azure VM?Show
IaaS.
-
2.Name three resources a VM needs.Show
A disk, a network interface and a virtual network.
-
3.How do you stop paying for VM compute?Show
Deallocate it (Stop in the portal or az vm deallocate).
-
4.What does the VM size control?Show
The amount of vCPU, memory and related capacity.
-
5.Who patches the VM's operating system?Show
You, the customer.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: VM Scale Sets and Availability Sets