Availability sets offer some protection against unplanned maintenance for your Azure Resource Manager assets. If a hardware or Azure software failure occurs, only a subset of the VMs in the availability group are impacted, and your overall application stays up. Availability Sets are an essential capability when you want to build reliable applications in Azure’s cloud.

If you have an application with 2 front-end servers and 2 backend SQL servers, you will want two availability sets before you deploy your VMs: one availability set for the front-end servers and one availability set for the database servers. When you create a new Azure RM VM you can set the availability set in the Azure Portal or as a parameter to the az vm create command. Azure will place your VMs that are created within the availability set on separate physical servers, compute racks, storage units, and network switches.

Each virtual machine in your availability set is assigned an update domain and a fault domain by the underlying Azure platform. For an availability set, 5 update domains are assigned by default and can be increased to 20 to indicate VMs and the underlying hardware that can be rebooted at the same time. The order of update domains being rebooted may not proceed sequentially during planned maintenance, but only one update domain is rebooted at a time. A rebooted update domain is given 30 minutes to recover before maintenance is initiated on a different update domain.

Fault domains define the group of VMs that share a common power source and network switch. The default the VMs in an availability set are separated across up to three fault domains.

Here is a diagram showing the difference between fault domains and update domains:

Here is how to create a new Availability Set in the Azure Eastern US data center.

Below is a script that will create 2 VMs in an availability set:

The script will take several minutes to create and configure both VMs. When finished, you’ll have two Azure RM VMs distributed across physical servers, compute racks, storage units, and network switches.

If you require high availability for your application, you will want to test your application in Azure’s preview feature Availability Zones which will allow you to have redundancy across data centers.

As more and more workloads are moved to Azure, please keep in mind that the redundancy that’s built into an on-premise solution will still need to be replicated in Azure as well.

Like this post? Share it!