az network nsg
Manage network security groups.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az network nsg create |
Create a network security group. |
Core | Preview |
| az network nsg delete |
Delete a network security group. |
Core | Preview |
| az network nsg list |
List network security groups. |
Core | Preview |
| az network nsg show |
Show a network security group. |
Core | Preview |
az network nsg create
Create a network security group.
Create an Azure network security group. When --location is omitted, the resource group's location is used.
az network nsg create --name
--resource-group
[--location]
[--profile]
[--subscription-id]
[--tags]
Examples
Create a network security group with tags
az network nsg create --name my-nsg --resource-group my-rg --location eastus --tags owner=network env=test
Create in the resource group's location
az network nsg create --name my-nsg --resource-group my-rg
Required Parameters
The name of the network security group.
The resource group name.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Location for the network security group. Defaults to the resource group's location.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Resource tags in KEY=VALUE form (space-separated).
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az network nsg delete
Delete a network security group.
Delete an Azure network security group.
az network nsg delete --name
--resource-group
[--profile]
[--subscription-id]
Examples
Delete a network security group
az network nsg delete --name my-nsg --resource-group my-rg
Required Parameters
The name of the network security group.
The resource group name.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az network nsg list
List network security groups.
List network security groups in a resource group, or omit the resource group to list across the subscription.
az network nsg list [--profile]
[--resource-group]
[--subscription-id]
Examples
List network security groups in a resource group
az network nsg list --resource-group my-rg
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Use the named profile for this command (overrides the active profile).
The resource group name. Omit to list every network security group in the subscription.
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az network nsg show
Show a network security group.
Retrieve a single Azure network security group.
az network nsg show --name
--resource-group
[--expand]
[--profile]
[--subscription-id]
Examples
Show a network security group
az network nsg show --name my-nsg --resource-group my-rg
Expand the associated network interfaces
az network nsg show --name my-nsg --resource-group my-rg --expand networkInterfaces
Required Parameters
The name of the network security group.
The resource group name.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Expand referenced resources, e.g. networkInterfaces or subnets.
Use the named profile for this command (overrides the active profile).
Azure Subscription Id. Defaults to the active profile's subscription.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.