PowerShell: 201-2-vms-internal-load-balancer

Create 2 Virtual Machines under an Internal Load balancer and configures Load Balancing rules for the VMs


This is a conversion of ARM template 201-2-vms-internal-load-balancer  from the repository azure\azure-quickstart-templates  to PowerShell Script.

This script allows you to create 2 Virtual Machines under an Internal Load balancer, and also deploys a Storage Account, Virtual Network, Availability Set and Network Interfaces. The Azure Load Balancer is assigned a static IP in the Virtual Network and is configured to load balance on Port 80, and it will deploy the following resources…

… and in-addition to it, just in-case if the deployment is not successful, then it will rollback the entire deployment.


If the specified resource group is already exist then the script will not continue with the deployment.


Deploy-AzResource.ps1 [-ResourceGroupName] <string> [-Location] <string> [-AdminCredential] <pscredential> [[-VMNamePrefix] <string>] [<CommonParameters>]


I 💙 PS> $Credential = Get-Credentials

PowerShell credential request
Enter your credentials.
User: sqladmin
Password for user sqladmin: *************

I 💙 PS> $param = @{
>> ResourceGroupName = 'azsqldb-rg'
>> Location = 'westus'
>> AdminCredential = $Credential
>> }

I 💙 PS> .\Deploy-AzResources.ps1 @param


Deployment is successful!


    View the code in GitHub  
Last modified: 21 August 2020

Share it on     |   |   |   | 
comments powered by Disqus