PowerShell: 101-loadbalancer-with-nat-rule

Virtual Network with two Subnets


This is a conversion of ARM template 101-loadbalancer-with-nat-rule  from the repository azure\azure-quickstart-templates  to PowerShell Script.

This script allows you to create a Load Balancer, Public IP address for the Load balancer, Virtual Network, Network Interface in the Virtual Network & a NAT Rule in the Load Balancer that is used by the Network Interface, 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> [[-AddressPrefix] <string>] [[-SubnetPrefix] <string>] [-DNSNameforLBIP] <string> [[-PublicIPAddressType] <string>] [<CommonParameters>]


I 💙 PS> $param = @{
>> ResourceGroupName = 'simple-rg'
>> Location = 'westus'
>> DNSNameforLBIP = 'lbwithnatrules'
>> }

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