Creating NSG using PowerShell

First off, you need to create a security rule and to do it, you need to run the following cmdlet:

$InboundRule = New-AzureRmNetworkSecurityRuleConfig -Name AllowingHTTP -Description "Allow HTTP" -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix Internet -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 80

Then, you can create the NSG with the previous rule added to it by running the following cmdlet:

$NSG = New-AzureRmNetworkSecurityGroup -ResourceGroupName PacktPub -Location westeurope -Name PSNSG -SecurityRules $InboundRule
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset