Contents

Azure Availability Sets vNet dependency

To guarantee high availability of a service on Azure, Availability Sets are a very popular way. But what are the requirements of this configuration for the underlying virtual network?

In most design documents you will find an image that looks similar to the following.

/en/azure-availability-sets-vnet-dependency/images/Azure_AvailabilitySet_OneSubnet.png

Two virtual machines in an Availability Set on the same subnet of a virtual network.

But what if I want to install the two virtual machines in different subnets or even different virtual networks?

Different virtual networks

Danger
This configuration is not supported!

/en/azure-availability-sets-vnet-dependency/images/Azure_AvailabilitySet_TwoVNet.png

If you try it anyway, the deployment of the ARM template is stopped after the creation of the virtual network card.

Failure

Subnet MYSUBNET referenced by resource /subscriptions/subscriptionId/resourceGroups/RESOURCEGROUP/providers/Microsoft.Network/networkInterfaces/NETWORKINTERFACE/ipConfigurations/ipconfig1 is not in the same Virtual Network /subscriptions/subscriptionId/resourceGroups/RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/MYSUBNET as the subnets of other VMs in the availability set

The error message you get is “SubnetsNotInSameVnet”.

Different subnets in the same virtual network

Unfortunately, the documentation is a bit scarce on this subject. I found semi-official information in a blog entry by Igor Pagliai from 2016.

The answer, and my tests confirm it, is: This configuration is supported and works fine.

/en/azure-availability-sets-vnet-dependency/images/Azure_AvailabilitySet_TwoSubnet.png