PowerShell: 101-azure-bastion-nsg

Deploy Azure Bastion in an Azure Virtual Network


This is a conversion of ARM template 101-azure-bastion-nsg  from the repository azure\azure-quickstart-templates  to PowerShell Script.

This script will deploy Azure Bastion in a new or existing Azure Virtual Network, along with dependent resources such as the AzureBastionSubnet, Public Ip Address for Azure Bastion, and Network Security Group rules, and deploys resources in the same Resource Group and Azure region as the Virtual Network, and it will deploy the following resources…


Deploy-AzResources.ps1 -VNetName <string> -BastionHostName <string> -BastionSubnetIPPrefix <string> [-ResourceGroupName <string>] [<CommonParameters>]

Deploy-AzResources.ps1 -ResourceGroupName <string> -Location <string> -VNetName <string> -VNetIPPrefix <string> -DefaultSubnetIPPrefix <string> -BastionHostName <string> -BastionSubnetIPPrefix <string> [<CommonParameters>]


I 💙 PS> $param = @{
>> resourceGroupName = 'rgroup01'
>> location = 'westus'
>> VNetName = 'vnet01'
>> VNetIPPrefix = ''
>> DefaultSubnetIPPrefix = ''
>> BastionHostName = 'bastionpc'
>> BastionSubnetIPPrefix = ''
>> }

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


bastionpc is successfully deployed.


    View the code in GitHub  
Last modified: 21 August 2020

Share it on     |   |   |   | 
comments powered by Disqus