Skip to content

Commit 5f5a4c7

Browse files
committed
fixes
1 parent 5d51fc9 commit 5f5a4c7

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

articles/virtual-network/tutorial-filter-network-traffic.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
title: "Tutorial: Filter network traffic with a network security group (NSG) - Azure portal"
33
titlesuffix: Azure Virtual Network
44
description: In this tutorial, you learn how to filter network traffic to a subnet, with a network security group (NSG), using the Azure portal.
5-
services: virtual-network
65
author: asudbring
76
ms.service: azure-virtual-network
87
ms.topic: tutorial
@@ -576,47 +575,47 @@ Add the network interface of each VM to one of the application security groups y
576575
Use [Get-AzNetworkInterface](/powershell/module/az.network/get-aznetworkinterface) to retrieve the network interface of the virtual machine, and then use [Get-AzApplicationSecurityGroup](/powershell/module/az.network/get-azapplicationsecuritygroup) to retrieve the application security group. Finally, use [Set-AzNetworkInterface](/powershell/module/az.network/set-aznetworkinterface) to associate the application security group with the network interface. The following example associates the _asg-web_ application security group with the _vm-web-nic_ network interface:
577576

578577
```azurepowershell-interactive
579-
$params = @{
578+
$params1 = @{
580579
Name = "vm-web-nic"
581580
ResourceGroupName = "test-rg"
582581
}
583-
$nic = Get-AzNetworkInterface @params
582+
$nic = Get-AzNetworkInterface @params1
584583
585-
$params = @{
584+
$params2 = @{
586585
Name = "asg-web"
587586
ResourceGroupName = "test-rg"
588587
}
589-
$asg = Get-AzApplicationSecurityGroup @params
588+
$asg = Get-AzApplicationSecurityGroup @params2
590589
591590
$nic.IpConfigurations[0].ApplicationSecurityGroups = @($asg)
592591
593-
$params = @{
592+
$params3 = @{
594593
NetworkInterface = $nic
595594
}
596-
Set-AzNetworkInterface @params
595+
Set-AzNetworkInterface @params3
597596
```
598597

599598
Repeat the command to associate the _asg-mgmt_ application security group with the _vm-mgmt-nic_ network interface.
600599

601600
```azurepowershell-interactive
602-
$params = @{
601+
$params1 = @{
603602
Name = "vm-mgmt-nic"
604603
ResourceGroupName = "test-rg"
605604
}
606-
$nic = Get-AzNetworkInterface @params
605+
$nic = Get-AzNetworkInterface @params1
607606
608-
$params = @{
607+
$params2 = @{
609608
Name = "asg-mgmt"
610609
ResourceGroupName = "test-rg"
611610
}
612-
$asg = Get-AzApplicationSecurityGroup @params
611+
$asg = Get-AzApplicationSecurityGroup @params2
613612
614613
$nic.IpConfigurations[0].ApplicationSecurityGroups = @($asg)
615614
616-
$params = @{
615+
$params3 = @{
617616
NetworkInterface = $nic
618617
}
619-
Set-AzNetworkInterface @params
618+
Set-AzNetworkInterface @params3
620619
```
621620

622621
### [CLI](#tab/cli)
@@ -686,17 +685,15 @@ $params = @{
686685
Name = "public-ip-vm-mgmt"
687686
ResourceGroupName = "test-rg"
688687
}
689-
Get-AzPublicIpAddress @params | Select IpAddress
688+
$publicIP = Get-AzPublicIpAddress @params | Select IpAddress
690689
```
691690

692-
Use the following command to create a remote desktop session with the _vm-mgmt_ VM from your local computer. Replace `<publicIpAddress>` with the IP address returned from the previous command.
691+
Use the following command to create a remote desktop session with the _vm-mgmt_ VM from your local computer.
693692

694693
```
695-
mstsc /v:<publicIpAddress>
694+
mstsc /v:$publicIP
696695
```
697696

698-
Open the downloaded RDP file. If prompted, select **Connect**.
699-
700697
Enter the user name and password you specified when creating the VM (you may need to select **More choices**, then **Use a different account**, to specify the credentials you entered when you created the VM), then select **OK**. You may receive a certificate warning during the sign-in process. Select **Yes** to proceed with the connection.
701698

702699
The connection succeeds, because port 3389 is allowed inbound from the internet to the _asg-mgmt_ application security group that the network interface attached to the _vm-mgmt_ VM is in.

0 commit comments

Comments
 (0)