Deploy virtual machine scale sets with IPv6 in Azure
This article shows you how to deploy a dual stack (IPv4 + IPv6) Virtual Machine Scale Set with a dual stack external load balancer in an Azure virtual network. The process to create an IPv6-capable virtual machine scale set is nearly identical to the process for creating individual VMs described here. You start with the steps that are similar to ones described for individual VMs:
- Create IPv4 and IPv6 Public IPs.
- Create a dual stack load balancer.
- Create network security group (NSG) rules.
The only step that is different from individual VMs is creating the network interface (NIC) configuration that uses the virtual machine scale set resource: networkProfile/networkInterfaceConfigurations. The JSON structure is similar to that of the Microsoft.Network/networkInterfaces object used for individual VMs with the addition of setting the NIC and the IPv4 IpConfiguration as the primary interface using the "primary": true attribute as seen in the following example:
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "[variables('nicName')]",
"properties": {
"primary": true,
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups','VmssNsg')]"
},
"ipConfigurations": [
{
"name": "[variables('ipConfigName')]",
"properties": {
"primary": true,
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', 'MyvirtualNetwork','Mysubnet')]"
},
"privateIPAddressVersion":"IPv4",
"publicipaddressconfiguration": {
"name": "pub1",
"properties": {
"idleTimeoutInMinutes": 15
}
},
"loadBalancerBackendAddressPools": [
{
"id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'loadBalancer', 'bePool'))]"
}
],
"loadBalancerInboundNatPools": [
{
"id": "[resourceId('Microsoft.Network/loadBalancers/inboundNatPools', 'loadBalancer', 'natPool')]"
}
]
}
},
{
"name": "[variables('ipConfigNameV6')]",
"properties": {
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets','MyvirtualNetwork','Mysubnet')]"
},
"privateIPAddressVersion":"IPv6",
"loadBalancerBackendAddressPools": [
{
"id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'loadBalancer','bePoolv6')]"
}
]
}
}
]
}
}
]
}
Sample virtual machine scale set template JSON
To deploy a dual stack (IPv4 + IPv6) Virtual Machine Scale Set with dual stack external Load Balancer and virtual network view sample template here.
Next steps
To learn more about IPv6 support in Azure virtual networks, see What is IPv6 for Azure Virtual Network?.