VM Scale Sets
VM Scale Sets are used for deploying multiple VMs at once without the need for manual actions or using scripts. You can then manage them all at once from a single place. VM Scale Sets are typically used to build large-scale infrastructures, where keeping all of your VMs in sync is key. The maintenance of VMs, including keeping them in sync, is handled by Azure.
VM Scale Sets use Availability Sets under the hood. VMs inside a scale set are automatically spread over the fault and update domains by the underlying platform. VM Scale Sets use Azure autoscale by default. You can, however, add or remove instances yourself instead of using autoscale.
When creating a scale set, a couple of artifacts are created for you automatically. As well as the number of VMs you have specified being added to the set, an Azure Load Balancer and Azure Autoscaling is added, along with a virtual network and a public IP:

Azure VM Scale Set architecture
Creating a VM Scale Set from the Azure Portal
- Navigate to the Azure Portal by opening https://portal.azure.com/.
- Click on
New
and type inScale
in the search bar. SelectVirtual machine scale set
. - In the next screen, click on
Create
and add the following settings before clicking theCreate
button:

Creating a VM Scale Set
After creation, you can manage the VM Scale Set from the Azure Portal as well as from PowerShell and CLI.
Accessing your VM Scale Sets
There are a number of ways to access your VM Scale Sets; they are as follows:
- Connect to VM instances using RDP or SSH: To connect to VM instances using RDP or SSH, you can configure a scale set to automatically assign a public IP address. This option is turned off by default. The VMs are inside a virtual network, making it impossible to connect to them using RDP or SSH.
- Connect to VM instances using a jumpbox: You can create a standalone VM inside the same virtual network to act as a jumpbox to connect to another scale set instance in the set. The standalone VM gets a public IP address, which can be connected using RDP or SSH. Once connected to the VM, you can use it to connect to other instances using the internal IP address.
- Connect to VM instances using NAT rules: You can also connect to VM instances using NAT rules that are created inside the load balancer. Those NAT rules assign the instances to a different RDP port.
- Distribute incoming traffic using load balancing: Incoming traffic can be distributed across VM instances using the round-robin approach. You can use the Azure Load Balancer and the Azure Application Gateway for this, where the former provides layer-4 load balancing rules, and the latter layer-7 load balancing rules.
VM Scale Set templates
You can also deploy VM Scale Sets using ARM templates. ARM templates are a great way to deploy solutions automatically, and you can even embed customization and extensions inside the template. You can, for instance, install an application inside a container and deploy it within the VM instances during the deployment process of your scale set.
There are also ARM templates provided by Microsoft and the community that have already been configured for different architectures; these can be downloaded and deployed to create Azure scale sets, with extensions to manage the scale sets included. Some examples of templates are as follows:
- Simple deployment of a VM Scale Set of Windows VMs behind a load balancer with NAT rules: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-nat
- Simple deployment of a VM Scale Set of Linux VMs behind a load balancer with NAT rules: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-linux-nat
- Simple deployment of a VM Scale Set of Linux VMs with a jumpbox: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-linux-jumpbox
- Windows VM Scale Set with Application Gateway Integration: https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-windows-app-gateway