Hi folks!
Today let’s create the network security group that has a very important role within Microsoft Azure. It works at layer 4, where we can communicate ports and IPs between internal or external networks through a VPN.
Now let’s assign the following variables:
$NSGName=”NSG-VM-01″
$RGName= “RG_GETPRACTICAL”
$LOCATION= “UKSOUTH”
Next, we will create a variable with the name of the port and which rule will be used. In this case, I am creating an “NSG” for RDP access.
$RULES = New-AzNetworkSecurityRuleConfig -Name ‘Default-Allow-RDP’ -Direction Inbound -Priority 1000 -Access Allow -SourceAddressPrefix ‘*’ -SourcePortRange ‘*’ -DestinationAddressPrefix ‘*’ -DestinationPortRange 3389 -Protocol TCP
Now let’s create the NSG, using the following command.
$NSG = New-AzNetworkSecurityGroup -Name $NSGName -ResourceGroupName $RGName -Location $LOCATION -SecurityRules $RULES
Your NSG was successfully created.
Thanks guys and until the next post, where I will demonstrate how to create a virtual machine using all these commands at once.
Joao Paulo Costa
Thanks so much for providing individuals with remarkably special opportunity to read from here. It is usually so excellent and also stuffed with amusement for me personally and my office acquaintances to visit the blog really thrice per week to read through the latest guides you will have. And definitely, I am also actually fascinated concerning the great tips you give. Some 2 areas in this posting are certainly the most effective I have ever had.
LikeLike
Thank you!
LikeLike
Thank you very much, pleased we could help you out!
LikeLike