2 VMs in a Load Balancer and load balancing rules

by ypitsch
Last updated: 28-04-2015

This template allows you to create 2 Virtual Machines under a Load balancer and configure a load balancing rule on Port 80. This template also deploys a Storage Account, Virtual Network, Public IP address, Availability Set and Network Interfaces. In this template, we use the resource loops capability to create the network interfaces and virtual machines

This Azure Resource Manager (ARM) template was created by a member of the community and not by Microsoft. Each ARM template is licensed to you under a licence agreement by its owner, not Microsoft. Microsoft is not responsible for ARM templates provided and licensed by community members and does not screen for security, compatibility or performance. Community ARM templates are not supported under any Microsoft support programme or service and are made available AS IS without warranty of any kind.


Parameter Name Description
storageAccountName Name of storage account
adminUsername Admin username
adminPassword Admin password
dnsNameforLBIP DNS for Load Balancer IP
vmNamePrefix Prefix to use for VM names
imagePublisher Image Publisher
imageOffer Image Offer
imageSKU Image SKU
lbName Load Balancer name
nicNamePrefix Network Interface name prefix
publicIPAddressName Public IP Name
vnetName VNET name
vmSize Size of the VM

Use the template


New-AzureRmResourceGroupDeployment -Name <deployment-name> -ResourceGroupName <resource-group-name> -TemplateUri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-2-vms-loadbalancer-lbrules/azuredeploy.json
Install and configure Azure PowerShell

Command line

azure config mode arm
azure group deployment create <my-resource-group> <my-deployment-name> --template-uri https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-2-vms-loadbalancer-lbrules/azuredeploy.json
Install and Configure the Azure Cross-Platform Command-Line Interface