|
1 | 1 | ---
|
2 |
| -title: Create, change, or delete an Azure network security group |
| 2 | +title: Create, Change, or Delete Azure Network Security Groups |
3 | 3 | titlesuffix: Azure Virtual Network
|
4 |
| -description: Learn how to create, change, or delete an Azure network security group (NSG). |
| 4 | +description: Learn to create, change, or delete Azure network security groups (NSGs) to control traffic flow and enhance network security with Portal, PowerShell, and CLI examples. |
5 | 5 | services: virtual-network
|
6 | 6 | author: asudbring
|
7 | 7 | ms.service: azure-virtual-network
|
8 | 8 | ms.topic: how-to
|
9 |
| -ms.date: 07/10/2025 |
| 9 | +ms.date: 07/26/2025 |
10 | 10 | ms.author: allensu
|
11 | 11 | ms.custom: template-how-to, engagement-fy23, devx-track-azurepowershell, devx-track-azurecli
|
12 | 12 | # Customer intent: As a network administrator, I want to create, change, or delete network security groups so that I can control the flow of network traffic and enhance the security of my virtual networks.
|
13 | 13 | ---
|
14 | 14 |
|
15 | 15 | # Create, change, or delete a network security group
|
16 | 16 |
|
17 |
| -Security rules in network security groups (NSGs) filter the type of network traffic that flows in and out of virtual network subnets and network interfaces (NICs). To learn more about NSGs, see [Network security group overview](./network-security-groups-overview.md). Next, complete the [Filter network traffic tutorial](tutorial-filter-network-traffic.md) to gain hands-on experience with NSGs. |
| 17 | +Network security groups (NSGs) control network traffic flow through security rules that filter traffic in and out of virtual network subnets and network interfaces. This guide shows you how to create, change, or delete network security groups to enhance your Azure virtual network security. Learn to manage NSG rules using the Azure portal, PowerShell, and Azure CLI. To learn more about NSGs, see [Network security group overview](./network-security-groups-overview.md). Next, complete the [Filter network traffic tutorial](tutorial-filter-network-traffic.md) to gain hands-on experience with NSGs. |
18 | 18 |
|
19 | 19 | ## Prerequisites
|
20 | 20 |
|
@@ -94,7 +94,7 @@ az network nsg create \
|
94 | 94 |
|
95 | 95 | In the search box at the top of the portal, enter **Network security group**. Select **Network security groups** in the search results to see the list of NSGs in your subscription.
|
96 | 96 |
|
97 |
| -:::image type="content" source="./media/manage-network-security-group/view-network-security-groups.png" alt-text="Screenshot that shows the Network security groups list in the Azure portal."::: |
| 97 | +:::image type="content" source="./media/manage-network-security-group/view-network-security-groups.png" alt-text="Screenshot of the Network security groups list in the Azure portal."::: |
98 | 98 |
|
99 | 99 | # [**PowerShell**](#tab/network-security-group-powershell)
|
100 | 100 |
|
@@ -127,7 +127,7 @@ az network nsg list --out table
|
127 | 127 |
|
128 | 128 | - In **Help**, view **Effective security rules**. For more information, see [Diagnose a virtual machine (VM) network traffic filter problem](diagnose-network-traffic-filter-problem.md).
|
129 | 129 |
|
130 |
| - :::image type="content" source="./media/manage-network-security-group/network-security-group-details-inline.png" alt-text="Screenshot that shows the Network security group page in the Azure portal." lightbox="./media/manage-network-security-group/network-security-group-details-expanded.png"::: |
| 130 | + :::image type="content" source="./media/manage-network-security-group/network-security-group-details-inline.png" alt-text="Screenshot of the Network security group page in the Azure portal." lightbox="./media/manage-network-security-group/network-security-group-details-expanded.png"::: |
131 | 131 |
|
132 | 132 | To learn more about the common Azure settings that are listed, see the following articles:
|
133 | 133 |
|
@@ -213,11 +213,11 @@ For more information about the association and dissociation of an NSG, see [Asso
|
213 | 213 |
|
214 | 214 | - To associate an NSG to the subnet, select **+ Associate**. Then select your virtual network and the subnet to which you want to associate the NSG. Select **OK**.
|
215 | 215 |
|
216 |
| - :::image type="content" source="./media/manage-network-security-group/associate-subnet-network-security-group.png" alt-text="Screenshot that shows associating a network security group to a subnet in the Azure portal."::: |
| 216 | + :::image type="content" source="./media/manage-network-security-group/associate-subnet-network-security-group.png" alt-text="Screenshot of associating a network security group to a subnet in the Azure portal."::: |
217 | 217 |
|
218 | 218 | - To dissociate an NSG from the subnet, select the three dots next to the subnet from which you want to dissociate the NSG, and then select **Dissociate**. Select **Yes**.
|
219 | 219 |
|
220 |
| - :::image type="content" source="./media/manage-network-security-group/dissociate-subnet-network-security-group.png" alt-text="Screenshot that shows dissociating an NSG from a subnet in the Azure portal."::: |
| 220 | + :::image type="content" source="./media/manage-network-security-group/dissociate-subnet-network-security-group.png" alt-text="Screenshot of dissociating an NSG from a subnet in the Azure portal."::: |
221 | 221 |
|
222 | 222 | # [**PowerShell**](#tab/network-security-group-powershell)
|
223 | 223 |
|
@@ -270,7 +270,7 @@ If an NSG is associated with any subnets or network interfaces, you can't delete
|
270 | 270 |
|
271 | 271 | 1. Select **Delete**, and then select **Yes** in the confirmation dialog box.
|
272 | 272 |
|
273 |
| - :::image type="content" source="./media/manage-network-security-group/delete-network-security-group.png" alt-text="Screenshot that shows deleting a network security group in the Azure portal."::: |
| 273 | + :::image type="content" source="./media/manage-network-security-group/delete-network-security-group.png" alt-text="Screenshot of deleting a network security group in the Azure portal."::: |
274 | 274 |
|
275 | 275 | # [**PowerShell**](#tab/network-security-group-powershell)
|
276 | 276 |
|
@@ -338,7 +338,7 @@ To learn more, see [Azure subscription and service limits, quotas, and constrain
|
338 | 338 | | **Name** | A unique name for the rule within the NSG | The name can be up to 80 characters. It must begin with a letter or number, and it must end with a letter, number, or underscore. The name can contain only letters, numbers, underscores, periods, or hyphens. |
|
339 | 339 | | **Description** | A text description | You can optionally specify a text description for the security rule. The description can't be longer than 140 characters. |
|
340 | 340 |
|
341 |
| - :::image type="content" source="./media/manage-network-security-group/add-security-rule.png" alt-text="Screenshot that shows adding a security rule to a network security group in the Azure portal."::: |
| 341 | + :::image type="content" source="./media/manage-network-security-group/add-security-rule.png" alt-text="Screenshot of adding a security rule to a network security group in the Azure portal."::: |
342 | 342 |
|
343 | 343 | # [**PowerShell**](#tab/network-security-group-powershell)
|
344 | 344 |
|
@@ -425,7 +425,7 @@ An NSG can contain multiple security rules. To learn more about the list of info
|
425 | 425 |
|
426 | 426 | The list contains any rules that you created and the [default security rules](./network-security-groups-overview.md#default-security-rules) of your NSG.
|
427 | 427 |
|
428 |
| - :::image type="content" source="./media/manage-network-security-group/view-security-rules.png" alt-text="Screenshot that shows inbound security rules of a network security group in the Azure portal."::: |
| 428 | + :::image type="content" source="./media/manage-network-security-group/view-security-rules.png" alt-text="Screenshot of inbound security rules of a network security group in the Azure portal."::: |
429 | 429 |
|
430 | 430 | # [**PowerShell**](#tab/network-security-group-powershell)
|
431 | 431 |
|
@@ -471,7 +471,7 @@ az network nsg rule list \
|
471 | 471 | > [!NOTE]
|
472 | 472 | > This procedure applies only to a custom security rule. It doesn't work if you choose a default security rule.
|
473 | 473 |
|
474 |
| - :::image type="content" source="./media/manage-network-security-group/view-security-rule-details.png" alt-text="Screenshot that shows the details of an inbound security rule of a network security group in the Azure portal."::: |
| 474 | + :::image type="content" source="./media/manage-network-security-group/view-security-rule-details.png" alt-text="Screenshot of the details of an inbound security rule of a network security group in the Azure portal."::: |
475 | 475 |
|
476 | 476 | # [**PowerShell**](#tab/network-security-group-powershell)
|
477 | 477 |
|
@@ -526,7 +526,7 @@ az network nsg rule show \
|
526 | 526 |
|
527 | 527 | 1. Change the rule's settings as needed, then select **Save**. For an explanation of all settings, see [Security rule settings](#security-rule-settings).
|
528 | 528 |
|
529 |
| - :::image type="content" source="./media/manage-network-security-group/change-security-rule.png" alt-text="Screenshot that shows changing the inbound security rule details of a network security group in the Azure portal."::: |
| 529 | + :::image type="content" source="./media/manage-network-security-group/change-security-rule.png" alt-text="Screenshot of changing the inbound security rule details of a network security group in the Azure portal."::: |
530 | 530 |
|
531 | 531 | > [!NOTE]
|
532 | 532 | > This procedure applies only to a custom security rule. You aren't allowed to change a default security rule.
|
@@ -593,11 +593,11 @@ az network nsg rule update \
|
593 | 593 |
|
594 | 594 | 1. Select **Inbound security rules** or **Outbound security rules**.
|
595 | 595 |
|
596 |
| -1. Select the rule that you want to delete. You may select more than one rule to delete at a time. |
| 596 | +1. Select the rule that you want to delete. You can select more than one rule to delete at a time. |
597 | 597 |
|
598 | 598 | 1. Select **Delete**, then select **Yes**.
|
599 | 599 |
|
600 |
| - :::image type="content" source="./media/manage-network-security-group/delete-security-rule.png" alt-text="Screenshot that shows deleting an inbound security rule of a network security group in the Azure portal."::: |
| 600 | + :::image type="content" source="./media/manage-network-security-group/delete-security-rule.png" alt-text="Screenshot of deleting an inbound security rule of a network security group in the Azure portal."::: |
601 | 601 |
|
602 | 602 | > [!NOTE]
|
603 | 603 | > This procedure applies only to a custom security rule. You aren't allowed to delete a default security rule.
|
@@ -706,7 +706,7 @@ az network asg create \
|
706 | 706 |
|
707 | 707 | In the search box at the top of the portal, enter **Application security group**. Then select **Application security groups** in the search results. A list of your application security groups appears in the Azure portal.
|
708 | 708 |
|
709 |
| -:::image type="content" source="./media/manage-network-security-group/view-application-security-groups.png" alt-text="Screenshot that shows existing application security groups in the Azure portal."::: |
| 709 | +:::image type="content" source="./media/manage-network-security-group/view-application-security-groups.png" alt-text="Screenshot of existing application security groups in the Azure portal."::: |
710 | 710 |
|
711 | 711 | # [**PowerShell**](#tab/network-security-group-powershell)
|
712 | 712 |
|
@@ -766,12 +766,12 @@ az network asg show \
|
766 | 766 |
|
767 | 767 | - Select **edit** next to **Tags** to add or remove tags. To learn more, see [Use tags to organize your Azure resources and management hierarchy](../azure-resource-manager/management/tag-resources.md).
|
768 | 768 |
|
769 |
| - :::image type="content" source="./media/manage-network-security-group/change-application-security-group.png" alt-text="Screenshot that shows changing an application security group in the Azure portal."::: |
| 769 | + :::image type="content" source="./media/manage-network-security-group/change-application-security-group.png" alt-text="Screenshot of changing an application security group in the Azure portal."::: |
770 | 770 |
|
771 | 771 | > [!NOTE]
|
772 | 772 | > You can't change the location of an application security group.
|
773 | 773 |
|
774 |
| - - Navigate to the **Access control (IAM)** blade to assign or remove permissions to the application security group. |
| 774 | + - Navigate to the **Access control (IAM)** section to assign or remove permissions to the application security group. |
775 | 775 |
|
776 | 776 | # [**PowerShell**](#tab/network-security-group-powershell)
|
777 | 777 |
|
@@ -815,7 +815,7 @@ You can't delete an application security group if it contains any network interf
|
815 | 815 |
|
816 | 816 | 1. Select **Delete**, and then select **Yes** to delete the application security group.
|
817 | 817 |
|
818 |
| - :::image type="content" source="./media/manage-network-security-group/delete-application-security-group.png" alt-text="Screenshot that shows deleting an application security group in the Azure portal."::: |
| 818 | + :::image type="content" source="./media/manage-network-security-group/delete-application-security-group.png" alt-text="Screenshot of deleting an application security group in the Azure portal."::: |
819 | 819 |
|
820 | 820 | # [**PowerShell**](#tab/network-security-group-powershell)
|
821 | 821 |
|
@@ -884,4 +884,4 @@ To manage NSGs, security rules, and application security groups, your account mu
|
884 | 884 |
|
885 | 885 | - Add or remove [a network interface to or from an application security group](./virtual-network-network-interface.md?tabs=network-interface-portal#add-or-remove-from-application-security-groups).
|
886 | 886 |
|
887 |
| -- Create and assign [Azure Policy definitions](./policy-reference.md) for virtual networks. |
| 887 | +- Create and assign [Azure Policy definitions](./policy-reference.md) for virtual networks. |
0 commit comments