Availability Zones, Availability Sets and VM Scale Sets
30-second answer
An availability set spreads VMs across fault domains (racks with their own power and network, up to 3) and update domains (rebooted one at a time, up to 20) inside one datacenter: 99.95% SLA with two or more VMs. Availability zones put VMs in separate datacenters in a region: 99.99%. A VM uses one or the other and you choose at creation. A Virtual Machine Scale Set runs identical VMs (use Flexible orchestration) across zones or fault domains, and autoscale rules add or remove instances on metrics such as Percentage CPU, between a minimum and maximum.
Simulate it » No Azure account neededExam objective: 3.2.6 Deploy virtual machines to availability zones and availability sets. 3.2.7 Deploy and configure an Azure Virtual Machine Scale Sets. (Skills measured as of April 17, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
In <strong>Create a virtual machine › Basics</strong>, <strong>Availability options</strong> decides how the VM survives failures. <strong>Availability zone</strong> with zones <strong>1, 2, 3</strong> creates three VMs, one per datacenter: 99.99% SLA.
👆 Click the glowing item in the portal to continue
Read the steps as text
- In Create a virtual machine › Basics, Availability options decides how the VM survives failures. Availability zone with zones 1, 2, 3 creates three VMs, one per datacenter: 99.99% SLA.
- Pick Availability set instead and the VM is spread across fault domains (racks) and update domains (maintenance groups) in one datacenter: 99.95% with two or more VMs. You choose this at creation; an existing VM can't join a set later.
- For identical VMs that grow and shrink, open Virtual machine scale sets and select + Create.
- Flexible orchestration is the recommended mode: instances spread across zones 1, 2, 3 and you can mix sizes. Set Scaling mode to Autoscaling and open the configuration.
- The default condition: keep 3 to 10 instances, add one when average CPU is above the scale-out threshold, remove one when it's below the scale-in threshold. The scale-in policy picks which instance goes first.
- The scale set is created with three instances, one per zone.
- On Instances, one VM landed in each zone. Now open Scaling.
- Custom autoscale holds the rules (Azure Monitor autoscale). When CPU crossed 70% the set grew by 2, then shrank as it cooled. CLI: az monitor autoscale create and az monitor autoscale rule create.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Availability sets vs zones
An availability set spreads VMs over fault domains (racks with their own power and network) and update domains in one datacenter: 99.95%. Availability zones spread VMs over separate datacenters: 99.99%. A VM uses one or the other, chosen at creation.
🤔 What happens if…
Read this tour as text
- A Bicep file becomes resources. A template has four parts: parameters (inputs such as
storageNameandskuName), variables (values worked out once), resources (what gets built) and outputs (values handed back). The CLI compiles Bicep to ARM JSON and Azure Resource Manager validates it, then builds it. - what-if, Incremental and Complete. what-if previews the changes (
+create,~modify,-delete) without touching anything. Incremental mode, the default, adds and updates. Complete mode also deletes whatever in the resource group isn't in the template. - Export and decompile. Export template (portal, or
az group export) writes what exists now as ARM JSON.az bicep decompileturns JSON into Bicep. Both are starting points: names and values are hard-coded and some properties are missing. - A VM, its host and its size. A VM runs on a physical host in a hardware cluster. Its size (Standard_D2s_v5: D family, 2 vCPUs, premium storage, v5) sets CPU, memory, disk count and price. A resize restarts the VM; a size that isn't on the current cluster needs the VM deallocated first.
- Disks and encryption at host. OS and data disks are managed disks in Azure Storage, encrypted at rest by default. The temp disk and the disk caches live on the host. Encryption at host encrypts those too, end to end; it needs the feature registered and the VM deallocated.
- Move to another resource group or subscription. A move keeps the region and the VM keeps running, but every resource ID changes. The VM must travel with its disks and network interface; across subscriptions the virtual network goes too.
- Move to another region. Azure Resource Mover copies resources to another region: add them, validate dependencies, prepare, initiate move, then commit (or discard) and delete the source.
- Availability sets vs zones. An availability set spreads VMs over fault domains (racks with their own power and network) and update domains in one datacenter: 99.95%. Availability zones spread VMs over separate datacenters: 99.99%. A VM uses one or the other, chosen at creation.
- Scale sets grow on a rule. A Virtual Machine Scale Set (Flexible orchestration recommended) runs identical VMs across zones. Autoscale rules add instances when average CPU is high and remove them when it's low, always between the minimum and maximum.
Contoso's web tier must survive a rack failure and a datacenter failure, and grow on busy afternoons. Build an availability set, zonal VMs and a Flexible scale set across three zones with CPU autoscale.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
One rack failure took the whole web tier offline.
😊 THE SOLUTION
Spread VMs across fault domains or zones and let a scale set add instances on demand.
- All VMs in one rack✓ Fault domains
- Datacenter outage✓ Availability zones
- Busy afternoons✓ Autoscale rules
Start with a question
Why do airlines put the pilot and co-pilot on different meals?
If both pilots eat the same fish and it’s bad, nobody flies the plane. So they eat different meals. One bad meal can’t take out both.
Azure does the same with your VMs. An availability set keeps them on different racks, so one power failure can’t take out both. Availability zones keep them in different buildings. And a scale set brings in extra crew when the plane gets busy.
Explain it like I’m 10
The technical explanation
Pick an availability option
| Option | Protects against | SLA (VM connectivity) | Set when |
|---|---|---|---|
| Single VM, Premium SSD or better on all disks | Little: one host | 99.9% | Any time |
| Availability set | Rack failure, host maintenance | 99.95% (2+ VMs) | VM creation only |
| Availability zones | A whole datacenter failing | 99.99% (2+ VMs in 2+ zones) | VM creation only |
| Scale set (zones or fault domains) | Same as the spread it uses, plus load | Same as above | Creation; instances added any time |
In the create wizard, Basics › Availability options offers No infrastructure redundancy required, Availability zone, Virtual machine scale set and Availability set. Selecting several zones creates one VM per zone.
Availability sets
An availability set spreads its VMs across fault domains (up to 3, region-dependent, default 2) and update domains (default 5, up to 20). VM 1 lands in FD0/UD0, VM 2 in FD1/UD1, and so on. The set is free; you pay for the VMs. A VM joins a set only when it’s created, and a VM can’t be in a set and a zone.
az vm availability-set create -g rg-contoso-prod -n avset-web \
--platform-fault-domain-count 2 --platform-update-domain-count 5
az vm create -g rg-contoso-prod -n vm-web-01 --image Ubuntu2404 --availability-set avset-web --generate-ssh-keys
New-AzAvailabilitySet -ResourceGroupName rg-contoso-prod -Name avset-web -Location eastus `
-PlatformFaultDomainCount 2 -PlatformUpdateDomainCount 5 -Sku Aligned
The Aligned SKU is needed for managed disks, so each VM’s disks sit in the same fault domain as the VM.
Availability zones
az vm create -g rg-contoso-prod -n vm-api-z1 --image Ubuntu2404 --zone 1 --generate-ssh-keys
az vm create -g rg-contoso-prod -n vm-api-z2 --image Ubuntu2404 --zone 2 --generate-ssh-keys
Zone numbers are per subscription, so your zone 1 may not be another subscription’s zone 1. Use zone-redundant (Standard SKU) public IPs and load balancers so the front door survives a zone too.
Virtual Machine Scale Sets
A scale set runs identical VMs and can grow and shrink. Flexible orchestration is the recommended mode: instances are normal VMs, sizes can be mixed and instances spread across zones or fault domains. Uniform is the older mode for large fleets of identical instances, with an upgrade policy (Manual, Automatic or Rolling) for model changes.
az vmss create -g rg-contoso-prod -n vmss-web --image Ubuntu2404 \
--orchestration-mode Flexible --zones 1 2 3 --instance-count 3 --vm-sku Standard_B2s --generate-ssh-keys
Autoscale (Azure Monitor) holds a default instance count, a minimum and a maximum, and rules. Portal: scale set › Scaling › Custom autoscale. CLI:
az monitor autoscale create -g rg-contoso-prod --resource vmss-web \
--resource-type Microsoft.Compute/virtualMachineScaleSets --name as-vmss-web \
--min-count 3 --max-count 10 --count 3
az monitor autoscale rule create -g rg-contoso-prod --autoscale-name as-vmss-web \
--condition "Percentage CPU > 70 avg 5m" --scale out 2
az monitor autoscale rule create -g rg-contoso-prod --autoscale-name as-vmss-web \
--condition "Percentage CPU < 30 avg 5m" --scale in 1
Rules have a cool down (5 minutes by default) so the set doesn’t react again before new instances settle. Always pair a scale-out rule with a scale-in rule, or the extra instances never leave. You can also add schedule-based profiles (“10 instances on weekdays 8 AM to 6 PM”) and a scale-in policy (Default, NewestVM or OldestVM). Manual scaling is az vmss scale --new-capacity 5.
Architect level Counting instances in an autoscale question
Say min 2, max 6, default 2, scale out by 2 when CPU is above 70% for 10 minutes, scale in by 1 below 30%, cool down 5 minutes. CPU sits at 85% for 30 minutes: the set goes 2 → 4, waits out the cool down, checks again, goes 4 → 6, then stops at the maximum. When CPU drops to 20%, it removes one at a time, each after a cool down, down to 2. If both a scale-out and a scale-in rule match at once, autoscale scales out, because availability wins over cost.
Real-world business scenario
Litware Media (fictional)
- The problem
- The web tier ran on four VMs in one rack. A switch failure took the site down for an hour, and Friday-night traffic doubled the CPU while weekday mornings sat idle.
- What they used
- A Flexible scale set across zones 1, 2 and 3 with a zone-redundant load balancer, autoscale from 3 to 12 instances (+2 above 70% CPU, -1 below 30%), and a schedule profile that starts at 6 instances every Friday at 6 PM. The two licensing servers that can't scale went into an availability set.
- Why that choice
- Zones protect against a datacenter failure, autoscale matches instances to load, and the availability set keeps the two fixed servers on different racks and update domains.
- The result
- The site rode through a later zone incident with no outage, and compute cost fell by about a third because quiet hours run only three instances.
When to use it and when not to
✓ Use it when…
- Availability zones for production VMs that must survive a datacenter outage.
- Availability sets in regions without zones, or for apps that need very low latency in one datacenter.
- Scale sets with autoscale for stateless tiers whose load changes.
✕ Think twice when…
- A single VM for anything with an uptime target. Two is the minimum for these SLAs.
- Autoscaling stateful servers that keep data on the instance.
↔ Alternatives to consider
- App Service or Container Apps for web workloads that scale without VM management.
- Azure Site Recovery for protection against a whole region failing.
- Proximity placement groups when VMs must sit physically close for low latency.
Test yourself with exercises
5 original practice questions in the AZ-104 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.
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's the difference between a fault domain and an update domain?
Model answer
A fault domain is about unplanned failures: VMs in different fault domains don't share a rack's power or switch. An update domain is about planned maintenance: Azure reboots one update domain at a time, so not all VMs go down together.
Intermediate Can you add an existing VM to an availability set or move it into a zone?
Model answer
Not by editing it. Both are chosen when the VM is created. To change them you recreate the VM from its disks with the set or zone selected, or use a zone move tool. And one VM can't be in an availability set and a zone at the same time.
Experienced developer Why would you choose a Flexible scale set over Uniform?
Model answer
Flexible is the recommended mode for new deployments. Instances are normal VMs you can manage with the usual VM commands, you can mix sizes and Spot with regular VMs, and it spreads across zones and fault domains for availability. Uniform suits huge fleets of identical instances and some older features, but most new work starts with Flexible.
Scenario Your web tier must survive a datacenter outage and handle Monday-morning peaks. What would you build?
Model answer
A Flexible scale set across zones 1, 2 and 3 behind a zone-redundant load balancer, with autoscale on average CPU, say plus two instances above 70% and minus one below 30%, minimum three so there's one per zone. I might add a scheduled profile to scale out before Monday 8 AM.
Quick revision
Key points
- Availability set - fault domains (up to 3) and update domains (default 5, up to 20) in one datacenter, 99.95%.
- Availability zones - separate datacenters in a region, 99.99% with VMs in two or more zones.
- Single VM with Premium SSD or better on all disks - 99.9%.
- Set and zone are chosen at creation; one VM can't use both.
- Scale sets - Flexible orchestration, zones, autoscale with min, max, default, scale-out and scale-in rules.
Important terminology
- Availability set
- A logical grouping that spreads VMs across fault domains and update domains in one datacenter.
- Fault domain
- A group of hardware that shares power and a network switch, like a rack. Up to 3 per availability set.
- Update domain
- A group of VMs that Azure reboots together during planned maintenance. 5 by default, up to 20.
- Availability zone
- A physically separate datacenter (or group of them) within a region, with its own power, cooling and networking.
- Virtual Machine Scale Set
- A group of VMs managed together that can scale out and in automatically.
- Flexible orchestration
- The recommended scale set mode. Instances are standard VMs, can mix sizes and are spread across zones or fault domains.
- Autoscale
- Azure Monitor rules that change the instance count based on metrics or a schedule, within minimum and maximum limits.
- Scale-in policy
- The rule that decides which instance is removed first when a scale set scales in.
Common mistakes
- Thinking an availability set protects against a whole datacenter failing.
- Creating a scale-out rule without a scale-in rule.
Exam tips
- "Survive a datacenter failure" = availability zones.
- "Survive a rack failure or host maintenance" = availability set.
- "Add VMs automatically when CPU is high" = scale set with autoscale.
Five quick revision questions
-
1.What is the maximum number of fault domains in an availability set?Show
3 (depends on the region).
-
2.What is the default number of update domains?Show
5.
-
3.What SLA do two or more VMs across availability zones get?Show
99.99%.
-
4.Which scale set orchestration mode is recommended for new deployments?Show
Flexible.
-
5.Which command creates an autoscale setting for a scale set?Show
az monitor autoscale create.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.
Next up: Azure Container Registry and Container Instances for Admins
Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges.