Skip to content

Commit e87a8bd

Browse files
committed
fixes
1 parent 1755f5f commit e87a8bd

File tree

1 file changed

+60
-64
lines changed

1 file changed

+60
-64
lines changed

articles/virtual-network/manage-network-security-group.md

Lines changed: 60 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The number of NSGs that you can create for each Azure region and subscription is
5151
| --- | --- |
5252
| **Project details** | |
5353
| Subscription | Select your Azure subscription. |
54-
| Resource group | Select an existing resource group, or create a new one by selecting **Create new**. This example uses the `myResourceGroup` resource group. |
54+
| Resource group | Select an existing resource group, or create a new one by selecting **Create new**. This example uses the `test-rg` resource group. |
5555
| **Instance details** | |
5656
| Network security group name | Enter a name for the NSG that you're creating. |
5757
| Region | Select the region that you want. |
@@ -62,13 +62,13 @@ The number of NSGs that you can create for each Azure region and subscription is
6262

6363
# [**PowerShell**](#tab/network-security-group-powershell)
6464

65-
Use [New-AzNetworkSecurityGroup](/powershell/module/az.network/new-aznetworksecuritygroup) to create an NSG named `myNSG` in the **East US** region. The NSG named `myNSG` is created in the existing `myResourceGroup` resource group.
65+
Use [New-AzNetworkSecurityGroup](/powershell/module/az.network/new-aznetworksecuritygroup) to create an NSG named `nsg-1` in the **East US** region. The NSG named `nsg-1` is created in the existing `test-rg` resource group.
6666

6767
```azurepowershell-interactive
6868
# Define parameters for the new network security group
6969
$NSGParams = @{
70-
Name = "myNSG"
71-
ResourceGroupName = "myResourceGroup"
70+
Name = "nsg-1"
71+
ResourceGroupName = "test-rg"
7272
Location = "eastus"
7373
}
7474
@@ -78,12 +78,12 @@ New-AzNetworkSecurityGroup @NSGParams
7878

7979
# [**Azure CLI**](#tab/network-security-group-cli)
8080

81-
Use [az network nsg create](/cli/azure/network/nsg#az-network-nsg-create) to create an NSG named `myNSG` in the existing `myResourceGroup` resource group.
81+
Use [az network nsg create](/cli/azure/network/nsg#az-network-nsg-create) to create an NSG named `nsg-1` in the existing `test-rg` resource group.
8282

8383
```azurecli-interactive
8484
az network nsg create \
85-
--resource-group MyResourceGroup
86-
--name myNSG
85+
--resource-group test-rg \
86+
--name nsg-1
8787
```
8888

8989
---
@@ -147,8 +147,8 @@ Use [Get-AzNetworkSecurityGroup](/powershell/module/az.network/get-aznetworksecu
147147
```azurepowershell-interactive
148148
# Define parameters for the network security group
149149
$NSGParams = @{
150-
Name = "myNSG"
151-
ResourceGroupName = "myResourceGroup"
150+
Name = "nsg-1"
151+
ResourceGroupName = "test-rg"
152152
}
153153
154154
# Retrieve the network security group
@@ -171,8 +171,8 @@ Use [az network nsg show](/cli/azure/network/nsg#az-network-nsg-show) to view th
171171

172172
```azurecli-interactive
173173
az network nsg show \
174-
--resource-group myResourceGroup \
175-
--name myNSG
174+
--resource-group test-rg \
175+
--name nsg-1
176176
```
177177

178178
To learn more about the common Azure settings that are listed, see the following articles:
@@ -225,11 +225,11 @@ Use [Set-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtu
225225
```azurepowershell-interactive
226226
# Define parameters for the virtual network and subnet configuration
227227
$VNetParams = @{
228-
Name = "myVNet"
229-
ResourceGroupName = "myResourceGroup"
228+
Name = "vnet-1"
229+
ResourceGroupName = "test-rg"
230230
}
231231
$SubnetParams = @{
232-
Name = "mySubnet"
232+
Name = "subnet-1"
233233
AddressPrefix = "10.0.0.0/24"
234234
NetworkSecurityGroup = $networkSecurityGroup
235235
}
@@ -250,10 +250,10 @@ Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az-network-vn
250250

251251
```azurecli-interactive
252252
az network vnet subnet update \
253-
--resource-group myResourceGroup \
254-
--vnet-name myVNet \
255-
--name mySubnet \
256-
--network-security-group myNSG
253+
--resource-group test-rg \
254+
--vnet-name vnet-1 \
255+
--name subnet-1 \
256+
--network-security-group nsg-1
257257
```
258258

259259
---
@@ -278,8 +278,8 @@ Use [Remove-AzNetworkSecurityGroup](/powershell/module/az.network/remove-aznetwo
278278
```azurepowershell-interactive
279279
# Define parameters for the network security group to be removed
280280
$NSGParams = @{
281-
Name = "myNSG"
282-
ResourceGroupName = "myResourceGroup"
281+
Name = "nsg-1"
282+
ResourceGroupName = "test-rg"
283283
}
284284
285285
# Remove the network security group
@@ -292,8 +292,8 @@ Use [az network nsg delete](/cli/azure/network/nsg#az-network-nsg-delete) to del
292292

293293
```azurecli-interactive
294294
az network nsg delete \
295-
--resource-group myResourceGroup \
296-
--name myNSG
295+
--resource-group test-rg \
296+
--name nsg-1
297297
```
298298

299299
---
@@ -345,8 +345,8 @@ Use [Add-AzNetworkSecurityRuleConfig](/powershell/module/az.network/add-aznetwor
345345
```azurepowershell-interactive
346346
# Define parameters for the network security group and security rule
347347
$NSGParams = @{
348-
Name = "myNSG"
349-
ResourceGroupName = "myResourceGroup"
348+
Name = "nsg-1"
349+
ResourceGroupName = "test-rg"
350350
}
351351
$RuleParams = @{
352352
Name = "RDP-rule"
@@ -377,8 +377,8 @@ Use [az network nsg rule create](/cli/azure/network/nsg/rule#az-network-nsg-rule
377377

378378
```azurecli-interactive
379379
az network nsg rule create \
380-
--resource-group myResourceGroup \
381-
--nsg-name myNSG \
380+
--resource-group test-rg \
381+
--nsg-name nsg-1 \
382382
--name RDP-rule \
383383
--priority 300 \
384384
--destination-address-prefixes '*' \
@@ -431,8 +431,8 @@ Use [Get-AzNetworkSecurityRuleConfig](/powershell/module/az.network/get-aznetwor
431431
```azurepowershell-interactive
432432
# Define parameters for the network security group
433433
$NSGParams = @{
434-
Name = "myNSG"
435-
ResourceGroupName = "myResourceGroup"
434+
Name = "nsg-1"
435+
ResourceGroupName = "test-rg"
436436
}
437437
438438
# Retrieve the network security group
@@ -448,8 +448,8 @@ Use [az network nsg rule list](/cli/azure/network/nsg/rule#az-network-nsg-rule-l
448448

449449
```azurecli-interactive
450450
az network nsg rule list \
451-
--resource-group myResourceGroup \
452-
--nsg-name myNSG
451+
--resource-group test-rg \
452+
--nsg-name nsg-1
453453
```
454454

455455
---
@@ -477,8 +477,8 @@ Use [Get-AzNetworkSecurityRuleConfig](/powershell/module/az.network/get-aznetwor
477477
```azurepowershell-interactive
478478
# Define parameters for the network security group and security rule
479479
$NSGParams = @{
480-
Name = "myNSG"
481-
ResourceGroupName = "myResourceGroup"
480+
Name = "nsg-1"
481+
ResourceGroupName = "test-rg"
482482
}
483483
$RuleParams = @{
484484
Name = "RDP-rule"
@@ -500,8 +500,8 @@ Use [az network nsg rule show](/cli/azure/network/nsg/rule#az-network-nsg-rule-s
500500

501501
```azurecli-interactive
502502
az network nsg rule show \
503-
--resource-group myResourceGroup \
504-
--nsg-name myNSG \
503+
--resource-group test-rg \
504+
--nsg-name nsg-1 \
505505
--name RDP-rule
506506
```
507507

@@ -535,8 +535,8 @@ Use [Set-AzNetworkSecurityRuleConfig](/powershell/module/az.network/set-aznetwor
535535
```azurepowershell-interactive
536536
# Define parameters for the network security group and security rule
537537
$NSGParams = @{
538-
Name = "myNSG"
539-
ResourceGroupName = "myResourceGroup"
538+
Name = "nsg-1"
539+
ResourceGroupName = "test-rg"
540540
}
541541
$RuleParams = @{
542542
Name = "RDP-rule"
@@ -570,8 +570,8 @@ Use [az network nsg rule update](/cli/azure/network/nsg/rule#az-network-nsg-rule
570570

571571
```azurecli-interactive
572572
az network nsg rule update \
573-
--resource-group myResourceGroup \
574-
--nsg-name myNSG \
573+
--resource-group test-rg \
574+
--nsg-name nsg-1 \
575575
--name RDP-rule \
576576
--priority 200
577577
```
@@ -606,8 +606,8 @@ Use [Remove-AzNetworkSecurityRuleConfig](/powershell/module/az.network/remove-az
606606
```azurepowershell-interactive
607607
# Define parameters for the network security group and security rule
608608
$NSGParams = @{
609-
Name = "myNSG"
610-
ResourceGroupName = "myResourceGroup"
609+
Name = "nsg-1"
610+
ResourceGroupName = "test-rg"
611611
}
612612
$RuleParams = @{
613613
Name = "RDP-rule"
@@ -632,8 +632,8 @@ Use [az network nsg rule delete](/cli/azure/network/nsg/rule#az-network-nsg-rule
632632

633633
```azurecli-interactive
634634
az network nsg rule delete \
635-
--resource-group myResourceGroup \
636-
--nsg-name myNSG \
635+
--resource-group test-rg \
636+
--nsg-name nsg-1 \
637637
--name RDP-rule
638638
```
639639

@@ -659,7 +659,7 @@ An application security group contains zero or more network interfaces. To learn
659659
| --- | --- |
660660
| **Project details** | |
661661
| Subscription | Select your Azure subscription. |
662-
| Resource group | Select an existing resource group, or create a new one by selecting **Create new**. This example uses the `myResourceGroup` resource group. |
662+
| Resource group | Select an existing resource group, or create a new one by selecting **Create new**. This example uses the `test-rg` resource group. |
663663
| **Instance details** | |
664664
| Name | Enter a name for the application security group that you're creating. |
665665
| Region | Select the region in which you want to create the application security group. |
@@ -676,8 +676,8 @@ Use [New-AzApplicationSecurityGroup](/powershell/module/az.network/new-azapplica
676676
```azurepowershell-interactive
677677
# Define parameters for the new application security group
678678
$ASGParams = @{
679-
ResourceGroupName = "myResourceGroup"
680-
Name = "myASG"
679+
ResourceGroupName = "test-rg"
680+
Name = "asg-1"
681681
Location = "eastus"
682682
}
683683
@@ -691,8 +691,8 @@ Use [az network asg create](/cli/azure/network/asg#az-network-asg-create) to cre
691691

692692
```azurecli-interactive
693693
az network asg create \
694-
--resource-group myResourceGroup \
695-
--name myASG \
694+
--resource-group test-rg \
695+
--name asg-1 \
696696
--location eastus
697697
```
698698

@@ -719,7 +719,7 @@ Use [az network asg list](/cli/azure/network/asg#az-network-asg-list) to list al
719719

720720
```azurecli-interactive
721721
az network asg list \
722-
--resource-group myResourceGroup \
722+
--resource-group test-rg \
723723
--out table
724724
```
725725

@@ -737,7 +737,7 @@ az network asg list \
737737
Use [Get-AzApplicationSecurityGroup](/powershell/module/az.network/get-azapplicationsecuritygroup) to view the details of an application security group.
738738

739739
```azurepowershell-interactive
740-
Get-AzApplicationSecurityGroup -Name myASG
740+
Get-AzApplicationSecurityGroup -Name asg-1
741741
```
742742

743743
# [**Azure CLI**](#tab/network-security-group-cli)
@@ -746,8 +746,8 @@ Use [az network asg show](/cli/azure/network/asg#az-network-asg-show) to view th
746746

747747
```azurecli-interactive
748748
az network asg show \
749-
--resource-group myResourceGroup \
750-
--name myASG
749+
--resource-group test-rg \
750+
--name asg-1
751751
```
752752

753753
---
@@ -775,18 +775,14 @@ az network asg show \
775775
```azurepowershell-interactive
776776
# Define parameters for the application security group
777777
$ASGParams = @{
778-
ResourceGroupName = "myResourceGroup"
779-
Name = "myASG"
778+
ResourceGroupName = "test-rg"
779+
Name = "asg-1"
780780
}
781781
782782
# Retrieve the application security group
783783
$applicationSecurityGroup = Get-AzApplicationSecurityGroup @ASGParams
784784
785-
# Update the tags for the application security group
786-
$applicationSecurityGroup.Tags = @{"Dept" = "Finance"}
787-
788-
# Apply the changes to the application security group
789-
Set-AzApplicationSecurityGroup -ApplicationSecurityGroup $applicationSecurityGroup
785+
New-AzTag -ResourceId $applicationSecurityGroup.Id -Tag @{ Dept = "Finance" }
790786
```
791787

792788
# [**Azure CLI**](#tab/network-security-group-cli)
@@ -795,8 +791,8 @@ Use [az network asg update](/cli/azure/network/asg#az-network-asg-update) to upd
795791

796792
```azurecli-interactive
797793
az network asg update \
798-
--resource-group myResourceGroup\
799-
--name myASG \
794+
--resource-group test-rg\
795+
--name asg-1 \
800796
--tags Dept=Finance
801797
```
802798

@@ -826,8 +822,8 @@ Use [Remove-AzApplicationSecurityGroup](/powershell/module/az.network/remove-aza
826822
```azurepowershell-interactive
827823
# Define parameters for the application security group to be removed
828824
$ASGParams = @{
829-
ResourceGroupName = "myResourceGroup"
830-
Name = "myASG"
825+
ResourceGroupName = "test-rg"
826+
Name = "asg-1"
831827
}
832828
833829
# Remove the application security group
@@ -840,8 +836,8 @@ Use [az network asg delete](/cli/azure/network/asg#az-network-asg-delete) to del
840836

841837
```azurecli-interactive
842838
az network asg delete \
843-
--resource-group myResourceGroup \
844-
--name myASG
839+
--resource-group test-rg \
840+
--name asg-1
845841
```
846842

847843
---

0 commit comments

Comments
 (0)