Availability sets vs availability zones

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Availability set vs availability zone is the first high-availability decision you’ll make for VMs. Both keep your copies apart so a single hardware fault or maintenance event can’t take them all down, but they guard against failures of different sizes, and you can’t use both on the same VM.

Two VMs “for high availability” don’t help much if they’re sitting in the same rack or the same building. Azure won’t spread them out unless you ask, and the only time you can ask is when you create them.

In the lab you’ll build an availability set with two VMs and look at their fault and update domains, compare them with a zonal VM, and hit the two errors people get when they decide too late.

TimeYou needCostBy the end you can
About 45 minutesvnet-saat, the CLICovered by the free account’s B2ats v2 hours (three small VMs for under an hour)Explain fault domains, update domains and zones, and place VMs so one failure can’t take them all

What it is, in one line

An availability set spreads VMs across racks inside one data centre, while availability zones spread them across separate data centres in a region.

In Simple Words

Spreading the school’s exam papers

A school keeps two copies of its exam papers, and if both sit in the same cupboard one leaking pipe ruins the lot. So the head teacher puts them in two different cupboards in the same building, each on its own wall socket, and that’s an availability set.

A more careful head teacher keeps the second copy in another building across town with its own electricity and water tank, so even a fire in one building can’t hurt both. That’s availability zones. Either way, you decide where the copies go when you file them, because moving one to a different cupboard later means making a fresh copy.

Engineer's View

Fault domains, update domains and zones

  • Fault domain (FD): hardware that shares power and a network switch, which is roughly a rack. An availability set spreads VMs over up to 3 FDs (2 in some regions).
  • Update domain (UD): a group that Azure reboots together during platform maintenance. An availability set gets 5 UDs by default and can go up to 20, and only one UD is rebooted at a time.
  • Availability set: all the VMs stay in one data centre, and you’re protected against rack failures and planned host maintenance. It costs nothing, but VMs have to be added when they’re created and must live in the set’s resource group.
  • Availability zones: separate data centres in one region, each with its own power, cooling and network (Central India has three), so you’re protected even if a whole building fails. You pin each VM to a zone when you create it (--zone 1).
  • A VM goes into an availability set or a zone, never both, and you can’t add or change either on an existing VM. You’d have to rebuild it or redeploy from its disks.

SLA in short: a single VM on Premium SSD disks gets 99.9%, two or more VMs in an availability set get 99.95%, and two or more VMs across two or more zones get 99.99%. To earn that extra nine the app has to cope with losing a copy, which usually means a load balancer in front (Lesson 51).

Zones add a little network latency between copies, so for chatty tiers keep each app copy and its database copy in the same zone, and repeat that pair in every zone.

How it works, step by step

This is what happens to two VMs in an availability set during Azure’s monthly host maintenance:

Availability set vs availability zone compared: spread, failures survived and SLA
  1. When you create them, Azure puts app01 in FD 0 / UD 0 and app02 in FD 1 / UD 1.
  2. Maintenance begins on UD 0, and while the hosts in that group are updated, app01 may reboot or pause for a moment.
  3. Meanwhile app02 is in UD 1, so it carries on serving users.
  4. Once UD 0 is healthy again Azure moves on to UD 1, and now app01 serves while app02 restarts.
  5. If a rack’s power supply fails instead, only the VMs in that FD go down, because the rest are on separate power.

Zones apply the same idea one level higher: an entire data centre can fail and the VMs in the other zones keep running. Azure also does its maintenance one zone at a time.

Availability set update domains during Azure host maintenance

My rule of thumb for 2026 is to use zones wherever the region has them, like Central India, and fall back to availability sets in regions without zones (South India and West India) or for legacy apps that need very low latency between VMs in one building.

Hands-on lab: availability set vs availability zone

You’ll create an availability set with two VMs plus one zonal VM, and then compare where Azure put each of them. First load the network IDs and create the lab group:

$v = Get-Content C:\azure-lab\vnet-saat.json | ConvertFrom-Json
az group create --name rg-saat-l18 --tags course=saatvedha-azure lesson=18 -o none

1Check how many fault domains Central India offers

Run this:

az vm list-skus --location centralindia --resource-type availabilitySets --query "[?name=='Aligned'].capabilities[?name=='MaximumPlatformFaultDomainCount'].value" -o tsv

You should see something like this:

3

“Aligned” is the availability set type you use with managed disks, where the disks are placed in storage fault domains that match the VM’s fault domain.

2Create an availability set and two VMs in it

Run this (about four minutes):

az vm availability-set create --resource-group rg-saat-l18 --name avset-saat-l18 --platform-fault-domain-count 2 --platform-update-domain-count 5 --tags course=saatvedha-azure lesson=18 -o none
az vm create --resource-group rg-saat-l18 --name app01 --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B2ats_v2 --subnet $v.'snet-app' --availability-set avset-saat-l18 --public-ip-address '""' --nsg '""' --admin-username azureuser --generate-ssh-keys --os-disk-size-gb 64 --tags course=saatvedha-azure lesson=18 -o none
az vm create --resource-group rg-saat-l18 --name app02 --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B2ats_v2 --subnet $v.'snet-app' --availability-set avset-saat-l18 --public-ip-address '""' --nsg '""' --admin-username azureuser --generate-ssh-keys --os-disk-size-gb 64 --tags course=saatvedha-azure lesson=18 -o none

3See which fault and update domain each VM got

Run this:

foreach ($n in 'app01','app02') {
    az vm get-instance-view --resource-group rg-saat-l18 --name $n --query "{vm:name, faultDomain:instanceView.platformFaultDomain, updateDomain:instanceView.platformUpdateDomain}" -o table
}

You should see something like this:

Vm     FaultDomain    UpdateDomain
-----  -------------  --------------
app01  0              0
Vm     FaultDomain    UpdateDomain
-----  -------------  --------------
app02  1              1

They have a different fault domain and a different update domain, so a rack failure or a maintenance reboot only ever hits one of them.

4Create a zonal VM and compare

Run this:

az vm create --resource-group rg-saat-l18 --name zvm2 --image Canonical:ubuntu-24_04-lts:server:latest --size Standard_B2ats_v2 --subnet $v.'snet-mgmt' --zone 2 --public-ip-address '""' --nsg '""' --admin-username azureuser --generate-ssh-keys --os-disk-size-gb 64 --tags course=saatvedha-azure lesson=18 -o none
az vm list --resource-group rg-saat-l18 --query "[].{vm:name, zone:zones[0], availabilitySet:availabilitySet.id}" -o table
az vm show --resource-group rg-saat-vms --name web01 --query "{vm:name, zone:zones[0]}" -o table

You should see something like this:

Vm     Zone    AvailabilitySet
-----  ------  ------------------------------------------------------------------------------------------
app01          /subscriptions/.../resourceGroups/RG-SAAT-L18/providers/Microsoft.Compute/availabilitySets/AVSET-SAAT-L18
app02          /subscriptions/.../resourceGroups/RG-SAAT-L18/providers/Microsoft.Compute/availabilitySets/AVSET-SAAT-L18
zvm2    2
Vm     Zone
-----  ------
web01  1

app01 and app02 have a set but no zone. zvm2 is in zone 2 and web01 (from Lesson 15) is in zone 1, which means different data centres. Don’t worry that Azure stores the set’s ID in upper case; that’s normal.

Availability set lab: fault domain and update domain of each VM
app01 and app02 got different fault and update domains; zvm2 sits in zone 2.

✅ Checkpoint: app01 and app02 are in different fault and update domains, and zvm2 and web01 are in different zones.

Break It, Then Fix It

Both of these errors have the same cause, which is that placement gets decided at creation time.

1Break it: move an existing VM into another availability set

Create a second, empty set and try moving app02 into it:

az vm availability-set create --resource-group rg-saat-l18 --name avset-saat-l18b --platform-fault-domain-count 2 --tags course=saatvedha-azure lesson=18 -o none
$newSet = az vm availability-set show --resource-group rg-saat-l18 --name avset-saat-l18b --query id -o tsv
az vm deallocate --resource-group rg-saat-l18 --name app02
az vm update --resource-group rg-saat-l18 --name app02 --set availabilitySet.id=$newSet

You’ll get an error like this:

(PropertyChangeNotAllowed) Changing property 'availabilitySet.id' is not allowed.
Code: PropertyChangeNotAllowed

A VM can’t change its availability set or zone even when it’s deallocated, and you can’t add a set to a VM that was built without one either. At work this tends to start as “we’ll make it highly available later”, and later turns out to mean a rebuild.

Fix it: rebuild the VM in the right set. The usual way keeps the disk: note the OS disk, delete the VM but not the disk, and create a new VM from that disk with the new set. In this lab you only need to delete the extra set:

az vm availability-set delete --resource-group rg-saat-l18 --name avset-saat-l18b

2Break it: ask for more fault domains than the region has

Run this:

az vm availability-set create --resource-group rg-saat-l18 --name avset-saat-l18c --platform-fault-domain-count 4 --tags course=saatvedha-azure lesson=18

You’ll get an error like this:

(InvalidParameter) The specified fault domain count 4 must fall in the range 1 to 3.
Code: InvalidParameter

As step 1 showed, Central India allows up to 3 fault domains. Templates copied from another region or an old blog post often carry a number that doesn’t fit.

Fix it: use the region’s maximum or something lower, and check it with the command from step 1 first. Then clean up:

az group delete --name rg-saat-l18 --yes
C:\azure-lab\Find-LabResources.ps1 -Lesson 18

You should see this:

Nothing tagged course=saatvedha-azure is left.
Availability set errors: PropertyChangeNotAllowed and fault domain count
So both errors come from deciding placement too late, or from copying a number that belonged to another region.

✅ Checkpoint: Both errors reproduced, and nothing from Lesson 18 is left. web01 is untouched in rg-saat-vms.

This happened at work

“Highly available” on paper, one rack in practice

This was a government services portal with two web VMs and two app VMs behind load balancers, and the design document proudly said “N+1, highly available”. The trouble was that the VMs had been created one at a time over a year by different people, with no availability set and no zones, and Azure had happened to put both app VMs on hosts in the same rack.

Then a top-of-rack switch failed and both app VMs lost their network together. The load balancer had nowhere to send traffic, and citizens got errors for about an hour until the switch was replaced. In the post-incident review it took five minutes to spot the gap, because neither VM had any placement setting at all.

What they changed: they rebuilt every tier from Bicep across zones 1, 2 and 3 of Central India, setting each VM’s zone from its index. An Azure Policy now denies new production VMs that have neither a zone nor an availability set, and the architecture review checklist asks “where exactly does copy 2 live?” for every component.

Common mistakes and troubleshooting

MistakeWhat you seeWhat to do
“We’ll add HA later”PropertyChangeNotAllowed on availabilitySet.id or zoneChoose the set or zone when you create the VM, and plan for it from day one.
Two copies with no placement settingBoth fail togetherPut every copy of a tier in zones (or a set).
Fault domain count from another region“must fall in the range 1 to …”Look up MaximumPlatformFaultDomainCount for that region.
Trying to use a set and a zone togetherThe create failsChoose one: zones where the region has them, sets everywhere else.
Chatty tiers spread randomly across zonesSlow pages from extra round trips between zonesKeep each app copy with its database copy in the same zone, and repeat the pair per zone.
Treating one VM as highly availableOutages during host maintenanceRun at least two copies behind a load balancer.

Interview questions

Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. What’s the difference between an availability set and availability zones?

Why they ask this: It’s the main idea of this lesson.

How you might answer: An availability set spreads VMs over fault domains and update domains inside one data centre, so a rack failure or a maintenance round can’t hit them all. Availability zones go further and spread VMs over separate data centres in the region, so even if a whole building fails the others keep running.

2. What are fault domains and update domains?

Why they ask this: It’s a classic definition question.

How you might answer: A fault domain is hardware that shares power and networking, like a rack, and an update domain is a group Azure reboots together during planned maintenance. An availability set spreads VMs across both.

3. What SLA does Azure give for VMs across availability zones?

Why they ask this: They want the headline number along with the condition.

How you might answer: It’s 99.99 percent for two or more VMs spread over two or more zones in the same region. An availability set gives you 99.95 percent, and a single VM on Premium SSD gets 99.9 percent.

2–5 years experience

4. Can you put an existing VM into an availability set or zone?

Why they ask this: They want to hear that it’s a create-time decision.

How you might answer: No, both are fixed at creation, and if you try Azure returns PropertyChangeNotAllowed. You have to recreate the VM, normally by deleting it but keeping the disk, then building a new VM from that disk in the right set or zone.

5. Your app runs in a region without zones. How do you make it highly available?

Why they ask this: They’re looking for practical alternatives.

How you might answer: I’d run two or more VMs per tier in an availability set behind a load balancer, with the data on a database that does its own replication. For bigger failures I’d add disaster recovery to another region using Azure Site Recovery.

6. What trade-offs come with spreading tiers across zones?

Why they ask this: They want to know if you’ve thought about latency.

How you might answer: Every call across zones adds a bit of latency, and a chatty app makes a lot of calls. So for chatty tiers I’d keep each app copy next to its database copy in one zone and repeat that pair in each zone, which keeps normal traffic inside a single zone.

Senior level

7. How would you enforce that production VMs are always spread out?

Why they ask this: They want to see governance that works at scale.

How you might answer: I’d use Bicep modules that set the zone from the instance index and an Azure Policy that denies production VMs without a zone or availability set. On top of that, a regular Resource Graph report grouping VMs by tier and zone catches any two copies that ended up sharing one.

8. A legacy app needs very low latency between three VMs. How do you balance that with availability?

Why they ask this: They want nuance, because proximity and spread pull in opposite directions.

How you might answer: I’d keep each group of three close together in a proximity placement group with an availability set, so latency inside the group stays low. For resilience I’d run a second group in another zone or region and fail over between the groups, and accept a short switch-over time.

9. When would a scale set be better than individually placed VMs?

Why they ask this: They want to see if you’re thinking ahead to Lesson 20.

How you might answer: When you have lots of identical instances, like web servers. A Virtual Machine Scale Set with zones spreads the instances across zones on its own and can add or replace them, so I’m not placing each VM by hand.

Quick quiz

Q1. What does an availability set protect against?

  1. A whole region failing
  2. Rack failures and planned maintenance in one data centre
  3. DNS failures
  4. Accidental deletion
Show answer

B — It spreads VMs across fault and update domains in one data centre.

Q2. Which gives the highest VM SLA?

  1. One VM with Standard HDD
  2. Two VMs in an availability set
  3. Two or more VMs across availability zones
  4. One VM with Premium SSD
Show answer

C — Two or more VMs across zones: 99.99 percent.

Q3. Can an existing VM be moved into an availability set?

  1. Yes, any time
  2. Only when deallocated
  3. No, it must be recreated
  4. Only with Premium disks
Show answer

C — The set and zone are fixed at creation.

Q4. What is an update domain?

  1. A group of VMs rebooted together during maintenance
  2. A DNS zone
  3. A backup copy
  4. A type of disk
Show answer

A — Azure updates one update domain at a time.

Q5. Which Indian region has availability zones?

  1. South India
  2. West India
  3. Central India
  4. All of them
Show answer

C — Central India has three zones; the others use availability sets.

Quick recap

You now know how to keep copies apart at the rack level and at the building level, and why that decision has to come first.

  • Availability sets spread VMs across fault and update domains in one data centre.
  • Availability zones spread VMs across separate data centres in a region.
  • SLA: 99.9% single Premium VM, 99.95% set, 99.99% zones.
  • Sets and zones are picked at creation, and changing them means a rebuild.
  • Use zones where the region has them and sets where it doesn’t.

Next lesson

Lesson 19: Azure managed disks: types, data disks, snapshots, resize → Next you’ll add a data disk to web01, take a snapshot and grow the disk without losing any data.

Further reading: availability set vs availability zone

Want to go deeper into availability set vs availability zone? See Microsoft’s Availability sets overview and Availability options for Azure Virtual Machines. You can also see the full plan for this course on the Azure Cloud Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.