You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network/tutorial-filter-network-traffic.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,8 +129,7 @@ az network vnet subnet create \
129
129
--vnet-name vnet-1 \
130
130
--resource-group test-rg \
131
131
--name subnet-1 \
132
-
--address-prefix 10.0.0.0/24 \
133
-
--network-security-group nsg-1
132
+
--address-prefix 10.0.0.0/24
134
133
```
135
134
136
135
---
@@ -667,7 +666,7 @@ The virtual machine takes a few minutes to create. Don't continue with the next
667
666
668
667
Create two VMs in the virtual network so you can validate traffic filtering in a later step.
669
668
670
-
Create a VM with [az vm create](/cli/azure/vm). The following example creates a VM that serves as a web server. The `--asgs asg-web` option causes Azure to make the network interface it creates for the VM a member of the *asg-web* application security group. The `--nsg ""` option is specified to prevent Azure from creating a default network security group for the network interface Azure creates when it creates the VM. The command prompts you to create a password for the VM. SSH keys aren't used in this example to facilitate the later steps in this article. In a production environment, use SSH keys for security.
669
+
Create a VM with [az vm create](/cli/azure/vm). The following example creates a VM that serves as a web server. The `--nsg ""` option is specified to prevent Azure from creating a default network security group for the network interface Azure creates when it creates the VM. The command prompts you to create a password for the VM. SSH keys aren't used in this example to facilitate the later steps in this article. In a production environment, use SSH keys for security.
671
670
672
671
```azurecli-interactive
673
672
az vm create \
@@ -697,7 +696,7 @@ The VM takes a few minutes to create. After the VM is created, output similar to
697
696
}
698
697
```
699
698
700
-
Create a VM with [az vm create](/cli/azure/vm). The following example creates a VM that serves as a management server. The `--asgs asg-mgmt` option causes Azure to make the network interface it creates for the VM a member of the *asg-mgmt* application security group.
699
+
Create a VM with [az vm create](/cli/azure/vm). The following example creates a VM that serves as a management server.
701
700
702
701
The following example creates a VM and adds a user account. The `--generate-ssh-keys` parameter causes the CLI to look for an available ssh key in `~/.ssh`. If one is found, that key is used. If not, one is generated and stored in `~/.ssh`. Finally, we deploy the latest `Ubuntu 22.04` image.
703
702
@@ -793,10 +792,11 @@ Use [az network nic update](/cli/azure/network/nic) to associate the network int
793
792
nic_name=$(az vm show --resource-group test-rg --name vm-web --query 'networkProfile.networkInterfaces[0].id' -o tsv | xargs basename)
794
793
795
794
# Associate the application security group with the network interface
796
-
az network nic update \
797
-
--resource-group test-rg \
798
-
--name $nic_name \
799
-
--application-security-groups asg-web
795
+
az network nic ip-config update \
796
+
--name ipconfigvm-web \
797
+
--nic-name $nic_name \
798
+
--resource-group test-rg \
799
+
--application-security-groups asg-web
800
800
```
801
801
802
802
Repeat the command to associate the *asg-mgmt* application security group with the *vm-mgmt-nic* network interface.
@@ -806,10 +806,11 @@ Repeat the command to associate the *asg-mgmt* application security group with t
806
806
nic_name=$(az vm show --resource-group test-rg --name vm-mgmt --query 'networkProfile.networkInterfaces[0].id' -o tsv | xargs basename)
807
807
808
808
# Associate the application security group with the network interface
809
-
az network nic update \
810
-
--resource-group test-rg \
811
-
--name $nic_name \
812
-
--application-security-groups asg-mgmt
809
+
az network nic ip-config update \
810
+
--name ipconfigvm-mgmt \
811
+
--nic-name $nic_name \
812
+
--resource-group test-rg \
813
+
--application-security-groups asg-mgmt
813
814
```
814
815
815
816
---
@@ -922,7 +923,7 @@ To confirm that you can access the _vm-web_ web server from outside of Azure, op
922
923
923
924
### [CLI](#tab/cli)
924
925
925
-
Using an SSH client of your choice, connect to the VMs created previously. For example, the following command can be used from a command line interface such as [Windows Subsystem for Linux](/windows/wsl/install) to create an SSH session with the *vm-mgmt* VM. In the previous steps, we enabled Microsoft Entra ID sign-in for the VMs. You can sign-in to the virtual machines using your Microsoft Entra ID credentials or you can use the SSH key that you used to create the VMs. In the following example, we use the SSH key to sign in to management VM and then sign in to the web VM from the management VM with a password.
926
+
Using an SSH client of your choice, connect to the VMs created previously. For example, the following command can be used from a command line interface such as [Windows Subsystem for Linux](/windows/wsl/install) to create an SSH session with the *vm-mgmt* VM. You can sign-in to the virtual machines using your Microsoft Entra ID credentials or you can use the SSH key that you used to create the VMs. In the following example, we use the SSH key to sign in to management VM and then sign in to the web VM from the management VM with a password.
926
927
927
928
For more information about how to SSH to a Linux VM and sign in with Microsoft Entra ID, see [Sign in to a Linux virtual machine in Azure by using Microsoft Entra ID and OpenSSH](/entra/identity/devices/howto-vm-sign-in-azure-ad-linux).
0 commit comments