Configure a Virtual Machine Scale Set with an existing Azure Standard Load Balancer
Article
In this article, you'll learn how to configure a Virtual Machine Scale Set with an existing Azure Load Balancer. With an existing virtual network and standard sku load balancer, you can deploy a Virtual Machine Scale Set with a few clicks in the Azure portal, or with a few lines of code in the Azure CLI or Azure PowerShell using the tabs below.
You need an existing standard sku load balancer in the subscription where the Virtual Machine Scale Set will be deployed.
You need an Azure Virtual Network for the Virtual Machine Scale Set.
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
This article requires version 2.0.28 or later of the Azure CLI. If using Azure Poweshell Shell, the latest version is already installed.
Deploy a Virtual Machine Scale Set with existing load balancer
Deploy a Virtual Machine Scale Set with az vmss create.
Replace the values in brackets with the names of the resources in your configuration.
After the scale set has been created, the backend port cannot be modified for a load balancing rule used by a health probe of the load balancer. To change the port, you can remove the health probe by updating the Azure virtual machine scale set, update the port and then configure the health probe again.
An existing standard sku load balancer in the subscription where the Virtual Machine Scale Set will be deployed.
An Azure Virtual Network for the Virtual Machine Scale Set.
Note
Before you can use Azure CLI in Microsoft Azure operated by 21Vianet, please run az cloud set -n AzureChinaCloud first to change the cloud environment. If you want to switch back to Azure Public Cloud, run az cloud set -n AzureCloud again.
After the scale set has been created, the backend port cannot be modified for a load balancing rule used by a health probe of the load balancer. To change the port, you can remove the health probe by updating the Azure virtual machine scale set, update the port and then configure the health probe again.
Next steps
In this article, you deployed a Virtual Machine Scale Set with an existing Azure Load Balancer. To learn more about Virtual Machine Scale Sets and load balancer, see: