Create a Virtual Machine Scale Set in the Azure portal
A virtual machine scale set allows you to deploy and manage a set of identical, auto-scaling virtual machines. You can scale the number of VMs in the scale set manually, or define rules to autoscale based on resource usage such as CPU, memory demand, or network traffic. In this getting started article, you create a virtual machine scale set in the Azure portal. You can also create a scale set with the Azure CLI 2.0 or Azure PowerShell.
If you don't have an Azure subscription, create a free account before you begin.
Log in to Azure
Log in to the Azure portal at http://portal.azure.com.
Create virtual machine scale set
You can deploy a scale set with a Windows Server image or Linux image such as RHEL, CentOS, Ubuntu, or SLES.
- Click the New button found on the upper left-hand corner of the Azure portal.
- Search for scale set, choose Virtual machine scale set, then select Create.
- Enter a name for the scale set, such as myScaleSet.
- Select your desired OS type, such as Windows Server 2016 Datacenter.
- Enter your desired resource group name, such as myResourceGroup, and location, such as East US.
Enter your desired username, and select which authentication type you prefer.
- A Password must be at least 12 characters long and meet three out of the four following complexity requirements: one lower case character, one upper case character, one number, and one special character. For more information, see username and password requirements.
- If you select a Linux OS disk image, you can instead choose SSH public key. Only provide your public key, such as ~/.ssh/id_rsa.pub. You can use the Azure Cloud Shell from the portal to create and use SSH keys.
Enter a Public IP address name, such as myPublicIP.
- Enter a unique Domain name label, such as myuniquedns. This DNS label forms the base of the FQDN for the load balancer in front of the scale set.
To confirm the scale set options, select Create.
Connect to a VM in the scale set
When you create a scale set in the portal, a load balancer is created. Network Address Translation (NAT) rules are used to distribute traffic to the scale set instances for remote connectivity such as RDP or SSH.
To view these NAT rules and connection information for your scale set instances:
- Select the resource group you created in the previous step, such as myResourceGroup.
- From the list of resources, select your Load balancer, such as myScaleSetLab.
Choose Inbound NAT rules from the menu on the left-hand side of the window.
You can connect to each VM in the scale set using these NAT rules. Each VM instance lists a destination IP address and TCP port value. For example, if the destination IP address is 188.8.131.52 and the TCP port is 50001, you connect to the VM instance as follows:
- For a Windows scale set, connect to the VM instance with RDP on
- For a Linux scale set, connect to the VM instance with SSH on
ssh firstname.lastname@example.org -p 50001
When prompted, enter the credentials you specified from the previous step when you created the scale set. The scale set instances are regular VMs that you can interact with as normal. For more information on how to deploy and run applications on your scale set instances, see Deploy your application on virtual machine scale sets
Clean up resources
When no longer needed, delete the resource group, scale set, and all related resources. To do so, select the resource group for the VM and click Delete.
In this getting started article, you created a basic scale set in the Azure portal. For greater scalability and automation, expand your scale set with the following how-to articles:
- Deploy your application on virtual machine scale sets
- Automatically scale with Azure PowerShell, the Azure CLI, or the Azure portal
- Use automatic OS upgrades for your scale set VM instances