Share via


az stack-hci-vm network nsg

Note

This reference is part of the stack-hci-vm extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az stack-hci-vm network nsg command. Learn more about extensions.

Manage Network Security Groups (NSGs).

Commands

Name Description Type Status
az stack-hci-vm network nsg create

Create a network security group.

Extension GA
az stack-hci-vm network nsg delete

Delete a network security group.

Extension GA
az stack-hci-vm network nsg list

List network security groups.

Extension GA
az stack-hci-vm network nsg rule

Manage network security group rules.

Extension GA
az stack-hci-vm network nsg rule create

Create a network security group rule.

Extension GA
az stack-hci-vm network nsg rule delete

Delete a network security group rule.

Extension GA
az stack-hci-vm network nsg rule list

List all rules in a network security group.

Extension GA
az stack-hci-vm network nsg rule show

Get the details of a network security group rule.

Extension GA
az stack-hci-vm network nsg rule update

Update a network security group rule.

Extension GA
az stack-hci-vm network nsg show

Get information about a network security group.

Extension GA
az stack-hci-vm network nsg update

Update a network security group.

Extension GA

az stack-hci-vm network nsg create

Create a network security group.

az stack-hci-vm network nsg create --custom-location
                                   --name
                                   --resource-group
                                   [--location]
                                   [--polling-interval]
                                   [--tags]

Examples

Create an NSG in a resource group with tags.

az stack-hci-vm network nsg create -g MyResourceGroup -n MyNsg --tags foo=bar --custom-location $customLocationId

Required Parameters

--custom-location

The ID of the extended location.

--name -n

Name of the network security group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--location -l

If location is not specified, the location of the resource group is used.

--polling-interval

ARM polling interval for long running operations.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az stack-hci-vm network nsg delete

Delete a network security group.

az stack-hci-vm network nsg delete [--ids]
                                   [--name]
                                   [--polling-interval]
                                   [--resource-group]
                                   [--subscription]
                                   [--yes]

Examples

Delete an NSG in a resource group.

az stack-hci-vm network nsg delete -g MyResourceGroup -n MyNsg

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the network security group.

--polling-interval

ARM polling interval for long running operations.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az stack-hci-vm network nsg list

List network security groups.

az stack-hci-vm network nsg list [--resource-group]

Examples

List all NSGs in a resoure group

az stack-hci-vm network nsg list -g MyResourceGroup

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az stack-hci-vm network nsg show

Get information about a network security group.

az stack-hci-vm network nsg show [--ids]
                                 [--name]
                                 [--resource-group]
                                 [--subscription]

Examples

Delete an NSG in a resource group.

az stack-hci-vm network nsg show -g MyResourceGroup -n MyNsg

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

Name of the network security group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az stack-hci-vm network nsg update

Update a network security group.

This command can only be used to update the tags of an NSG. Name and resource group are immutable and cannot be updated.

az stack-hci-vm network nsg update --name
                                   --resource-group
                                   [--add]
                                   [--force-string]
                                   [--remove]
                                   [--set]
                                   [--tags]

Examples

Delete an NSG in a resource group.

az stack-hci-vm network nsg update -g MyResourceGroup -n MyNsg --tags foo=bar

Required Parameters

--name -n

Name of the network security group.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Default value: []
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Default value: False
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Default value: []
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Default value: []
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.