Home › Studies › AZ-104 › Compute › Availability & Scale Sets

Availability & Scale Sets

availability sets · zones · proximity placement · scale set modes · autoscale · scale-in · repairs · upgrades

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Availability sets vs availability zones

Availability setAvailability zone
What it spreads VMs acrossFault domains (shared power source and network switch) and update domains (planned maintenance groups)Physically separate zones in a region; each has distinct power, network and cooling
Protects againstPhysical hardware, network and power failures; planned maintenance one update domain at a timeLoss of a zone, if you deploy VMs in more than one zone and load-balance them
Does not protect againstOS or application failures; datacenter-level shared failures such as a datacenter network outageA single zonal VM is pinned to one zone and is not resilient to an outage of that zone by itself
SLA99.95% with two or more VMs in the setThe VM SLA uptime percentage increases with two or more VMs across two or more zones
LimitsUp to 3 fault domains and 20 update domains, fixed at creationThree zones per supported region (a few regions list four)
CostNo charge for the set; you pay for the VMsNo cost difference between zonal and nonzonal VMs
Add an existing VMOnly when the VM is created: delete and re-create the VM in the setA nonzonal VM can be moved to a zonal VM (new VM in the target zone). A zonal VM can't be converted back

Availability options are separate choices (zone, availability set, scale set, none). The orchestration-modes comparison lists availability sets as not supporting availability zones.

Availability set details

Availability zones for VMs

Proximity placement groups

Scale set orchestration modes

Flexible (recommended)Uniform
InstancesStandard Azure IaaS VMs; use the standard VM APIsScale-set-specific VMs; not compatible with the standard VM APIs, ARM tagging, per-VM RBAC, Azure Backup or Site Recovery
Add or remove existing VMsYesNo
Azure Backup, Site Recovery (PowerShell), assign a VM to a zone or fault domainYesNo
Automatic OS image upgrades, Basic Load Balancer, NAT pools, default outbound connectivityNot supportedSupported
Update domainsNone; host updates go fault domain by fault domainUp to 5
SLA99.95% across fault domains; 99.99% across multiple zones99.95% for FD>1 in a single placement group; 99.99% across multiple zones

Zones and fault domains in scale sets

Autoscale

ItemDetail
MethodsManual capacity, schedule, metric rules, or predictive autoscale. Autoscale needs the scale set to have a virtual machine scaling profile
ProfileMinimum, maximum and default instance counts. If min = max, no scale action can occur
Default countUsed when metrics can't be read. Below default: scale out to default. Above default: no scale in
Rule logicScale out if ANY rule is met. Scale in only if ALL scale-in rules are met
PairingAlways pair a scale-out rule with a scale-in rule, ideally on the same metric, to avoid flapping
Manual change outside min and maxAutoscale resets it on its next run (range 3-6, you set 8, it goes back to 6)
Host metrics (no agent)Percentage CPU, Network In/Out, Disk Read/Write Bytes and Operations/Sec, CPU Credits Remaining and Consumed
In-guest metrics such as memoryNeed the Azure diagnostics extension or Application Insights
Portal example rulePercentage CPU, Average, Greater than 70, 10 minutes, Increase percent by 20, cool down 5 minutes; scale in at CPU less than 30
Recurring schedule profileHas no end time and stays active until the next profile starts. Create another recurring profile to end it

Scale-in, protection and instance repairs

Upgrade policy and model changes

ModeBehaviorFits
ManualYou decide when existing instances update. New instances use the latest modelControl over timing
AutomaticNo ordering guarantee; may take all VMs down at onceDev/test
RollingUpdates in batches with health checks. Flexible needs the Application Health extensionProduction

Attach an existing VM to a Flexible scale set

CLI and PowerShell

TaskAzure CLIPowerShell
Create availability setaz vm availability-set create -n MyAvSet -g MyRG --platform-fault-domain-count 2 --platform-update-domain-count 2New-AzAvailabilitySet -Location EastUS -Name myAvailabilitySet -ResourceGroupName myRG -Sku aligned -PlatformFaultDomainCount 2 -PlatformUpdateDomainCount 2
Create VM in the setaz vm create ... --availability-set MyAvSetNew-AzVM ... -AvailabilitySetName "myAvailabilitySet"
Convert set to managed disksaz vm availability-set convert -g MyRG -n MyAvSet
Zonal VMaz vm create -g myRG -n myVM --image Ubuntu2204 --generate-ssh-keys --zone 1
Zone-spanning Flexible scale setaz vmss create -g myRG -n myScaleSet --orchestration-mode Flexible --image Ubuntu2204 --admin-username azureuser --zones 1 2 3 --generate-ssh-keysNew-AzVmss -ResourceGroupName myRG -Location EastUS -VMScaleSetName myScaleSet -OrchestrationMode Flexible
Manual scaleaz vmss scale --new-capacity 5 --name scaleSetName --resource-group rgUpdate-AzVmss -SkuCapacity 5 -ResourceGroupName rg -VMScaleSetName scaleSetName
Autoscale profileaz monitor autoscale create --resource-group rg --resource myScaleSet --resource-type Microsoft.Compute/virtualMachineScaleSets --name autoscale --min-count 2 --max-count 10 --count 2New-AzAutoscaleProfileObject, then New-AzAutoscaleSetting
Scale-out ruleaz monitor autoscale rule create -g rg --autoscale-name autoscale --condition "Percentage CPU > 70 avg 5m" --scale out 3New-AzAutoscaleScaleRuleObject ...
Scale-in ruleaz monitor autoscale rule create ... --condition "Percentage CPU < 30 avg 5m" --scale in 1same cmdlet with LessThan and Decrease
Scale-in policyaz vmss update -g rg -n vmss --scale-in-policy OldestVMUpdate-AzVmss -ResourceGroupName rg -VMScaleSetName vmss -ScaleInPolicy "OldestVM"
Instance protectionaz vmss update -g rg -n vmss --instance-id 0 --protect-from-scale-in true [--protect-from-scale-set-actions true]Update-AzVmssVM -ResourceGroupName rg -VMScaleSetName vmss -InstanceId 0 -ProtectFromScaleIn $true
Automatic repairs on updateaz vmss update ... --enable-automatic-repairs true --automatic-repairs-grace-period 30 --automatic-repairs-action ReplaceUpdate-AzVmss ... -EnableAutomaticRepair $true -AutomaticRepairGracePeriod "PT40M" -AutomaticRepairAction "Restart"
Update instances to latest modelaz vmss update-instances -g rg -n vmss --instance-ids "*"Update-AzVmssInstance -ResourceGroupName rg -VMScaleSetName vmss -InstanceId '*'
Attach existing VM to Flexible scale setaz vm update -g rg -n vm --set virtualMachineScaleSet.id='<vmssId>'Update-AzVM -ResourceGroupName rg -VM $vm -VirtualMachineScaleSetId $vmss.Id

Exam Tips

Tick each tip once you can answer it without looking.

“Two web VMs must survive a rack power failure and rolling host updates; the region has no availability zones” → Availability set with two or more VMs (fault domains for hardware, update domains for planned maintenance). Trap: one VM in a set doesn't meet the two-VM condition for the 99.95% SLA.

“Put an existing VM into an availability set” → Delete and re-create the VM in the set, keeping its disks. Trap: editing the VM's availability option. A VM can be added to a set only when it's created.

“Change the fault or update domain count of an existing availability set” → Not possible: create a new set and re-create the VMs. Trap: updating the existing set. The counts are fixed at creation.

“Survive the loss of an entire datacenter” → One VM per availability zone behind a load balancer. Trap: an availability set. Its fault domains are still exposed to datacenter-level shared failures.

“Single VM pinned to zone 2, and zone 2 fails” → The VM is down until the zone recovers. Trap: a zonal VM isn't zone-redundant, so it doesn't fail over by itself.

“Portal create VM, Availability zone, zones 1, 2 and 3 selected” → Three VMs, named with the suffixes -1, -2 and -3. Trap: expecting one VM replicated across three zones.

“Existing nonzonal VM must become zonal” → Move it: Azure creates a new VM in the target zone. Trap: planning to undo it later. A zonal VM can't be converted back to nonzonal.

“Scale set must reach a 99.99% SLA” → Spread instances across availability zones. Trap: more fault domains. Spreading across fault domains gives 99.95%.

“Zone-spanning scale set must keep zone counts equal, plus or minus one, even when scaling” → Set zoneBalance to true. Trap: the default, which is best-effort balancing.

“VMs need the lowest network latency, in one datacenter” → Proximity placement group; stop (deallocate) existing VMs before moving them in. Trap: using zones for latency. A single PPG can't span zones.

“Scale set mode that can add existing VMs, use standard VM APIs and Azure Backup” → Flexible orchestration. Trap: Uniform. Its instances aren't compatible with the standard VM APIs, Azure Backup or Site Recovery, and it can't attach existing VMs.

“Change a scale set from Uniform to Flexible” → Not possible: the orchestration mode is set at creation. Trap: updating the scale set. The mode can't be changed later.

“Scale out at CPU above 70% for 10 minutes with a 5-minute cool down” → Autoscale scale-out rule, paired with a scale-in rule (for example CPU below 30%). Trap: a scale-out rule alone. Microsoft says to pair it with a scale-in rule to avoid flapping.

“Two scale-in rules; only one of them is true” → No scale in: all scale-in rules must be true. Trap: assuming OR logic. Only scale out fires on any one rule.

“Autoscale metrics can't be read and the profile default is above current capacity” → Scale out to the default count. Trap: expecting a scale in when current capacity is already above the default. It doesn't scale in.

“Remove the most recently created instance on scale-in” → Scale-in policy NewestVM. Trap: the Default policy. It balances across zones and fault domains, then deletes the highest instance ID.

“One instance runs a long job and autoscale must not remove it” → Protect from scale-in on that instance. Trap: expecting it to stop you deleting the instance, or to block reimage and upgrade. Use protect from scale set actions for those.

“Production scale set must update in batches and keep instances available” → Rolling upgrade policy (Flexible needs the Application Health extension). Trap: Automatic, which may take all VMs down at once. Manual does nothing until you update the instances.

“Manual upgrade policy, image changed on the model, existing instances still old” → Run update-instances (az vmss update-instances --instance-ids "*"). Trap: waiting. Only new instances get the new model on their own.

“Replace unhealthy scale set instances automatically” → Automatic instance repairs with the Application Health extension or a load balancer probe. Trap: configuring both health sources. Repairs use only one at a time.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Moving ResourcesContainers →