Share via


az network nic

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Manage network interfaces.

To learn more about network interfaces in Azure, visit https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface?tabs=network-interface-portal.

Commands

Name Description Type Status
az network nic create

Create a network interface.

Core GA
az network nic delete

Delete a network interface.

Core GA
az network nic ip-config

Manage IP configurations of a network interface.

Core GA
az network nic ip-config address-pool

Manage address pools in an IP configuration.

Core GA
az network nic ip-config address-pool add

Add an address pool to an IP configuration.

Core GA
az network nic ip-config address-pool remove

Remove an address pool of an IP configuration.

Core GA
az network nic ip-config create

Create an IP configuration.

Core GA
az network nic ip-config delete

Delete an IP configuration.

Core GA
az network nic ip-config inbound-nat-rule

Manage inbound NAT rules of an IP configuration.

Core GA
az network nic ip-config inbound-nat-rule add

Add an inbound NAT rule to an IP configuration.

Core GA
az network nic ip-config inbound-nat-rule remove

Remove an inbound NAT rule of an IP configuration.

Core GA
az network nic ip-config inbound-nat-rule wait

Place the CLI in a waiting state until a condition is met.

Core GA
az network nic ip-config list

List the IP configurations of an NIC.

Core GA
az network nic ip-config show

Show the details of an IP configuration.

Core GA
az network nic ip-config update

Update an IP configuration.

Core GA
az network nic ip-config wait

Place the CLI in a waiting state until a condition is met.

Core GA
az network nic list

List network interfaces.

Core GA
az network nic list-effective-nsg

List all effective network security groups applied to a network interface.

Core GA
az network nic show

Get the details of a network interface.

Core GA
az network nic show-effective-route-table

Show the effective route table applied to a network interface.

Core GA
az network nic update

Update a network interface.

Core GA
az network nic vtap-config

Manage virtual network tap configurations.

Extension GA
az network nic vtap-config create

Create a virtual network tap configuration.

Extension GA
az network nic vtap-config delete

Delete a virtual network tap configuration.

Extension GA
az network nic vtap-config list

List virtual network tap configurations.

Extension GA
az network nic vtap-config show

Get details of a virtual network tap configuration.

Extension GA
az network nic vtap-config wait

Place the CLI in a waiting state until a condition is met.

Extension GA
az network nic wait

Place the CLI in a waiting state until a condition is met.

Core GA

az network nic create

Create a network interface.

az network nic create --name
                      --resource-group
                      --subnet
                      [--accelerated-networking {0, 1, f, false, n, no, t, true, y, yes}]
                      [--ag-address-pools --app-gateway-address-pools]
                      [--application-security-groups --asgs]
                      [--auxiliary-mode {AcceleratedConnections, Floating, MaxConnections, None}]
                      [--auxiliary-sku {A1, A2, A4, A8, None}]
                      [--dns-servers]
                      [--edge-zone]
                      [--gateway-name]
                      [--internal-dns-name]
                      [--ip-forwarding {0, 1, f, false, n, no, t, true, y, yes}]
                      [--lb-address-pools]
                      [--lb-inbound-nat-rules]
                      [--lb-name]
                      [--location]
                      [--network-security-group]
                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                      [--private-ip-address]
                      [--private-ip-address-version {IPv4, IPv6}]
                      [--public-ip-address]
                      [--tags]
                      [--vnet-name]

Examples

Create a network interface for a specified subnet on a specified virtual network.

az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic

Create a network interface for a specified subnet on a virtual network which allows IP forwarding subject to a network security group.

az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --ip-forwarding --network-security-group MyNsg

Create a network interface for a specified subnet on a virtual network with network security group and application security groups.

az network nic create -g MyResourceGroup --vnet-name MyVnet --subnet MySubnet -n MyNic --network-security-group MyNsg --application-security-groups Web App

Required Parameters

--name -n

Name of the network interface (NIC).

--resource-group -g

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

--subnet

Name or ID of an existing subnet. If name specified, please also specify --vnet-name; If you want to use an existing subnet in other resource group, please provide the ID instead of the name of the subnet.

Property Value
Parameter group: IP Configuration Arguments

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-networking

Whether to enable accelerated networking.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--ag-address-pools --app-gateway-address-pools

Space-separated list of names or IDs of application gateway backend address pools to associate with the NIC. If names are used, --gateway-name must be specified. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: Application Gateway Arguments
--application-security-groups --asgs

Space-separated list of application security groups. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: IP Configuration Arguments
--auxiliary-mode

Auxiliary mode of Network Interface resource.

Property Value
Parameter group: Properties Arguments
Accepted values: AcceleratedConnections, Floating, MaxConnections, None
--auxiliary-sku

Auxiliary sku of Network Interface resource.

Property Value
Parameter group: Properties Arguments
Accepted values: A1, A2, A4, A8, None
--dns-servers

Space-separated list of DNS server IP addresses. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: DNS Arguments
--edge-zone

Name of edge zone.

--gateway-name

Name of the application gateway.

Property Value
Parameter group: Application Gateway Arguments
--internal-dns-name

Name of internal DNS label.

Property Value
Parameter group: DNS Arguments
--ip-forwarding

Whether to enable IP forwarding.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--lb-address-pools

Space-separated list of names or IDs of load balancer address pools to associate with the NIC. If names are used, --lb-name must be specified. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: Load Balancer Arguments
--lb-inbound-nat-rules

Space-separated list of names or IDs of load balancer inbound NAT rules to associate with the NIC. If names are used, --lb-name must be specified. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: Load Balancer Arguments
--lb-name

Name of the load balancer.

Property Value
Parameter group: Load Balancer Arguments
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--network-security-group

Name or ID of an existing network security group.

--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--private-ip-address

Static private IP address to use.

Property Value
Parameter group: IP Configuration Arguments
--private-ip-address-version

Version of private IP address to use.

Property Value
Parameter group: IP Configuration Arguments
Default value: IPv4
Accepted values: IPv4, IPv6
--public-ip-address

Name or ID of an existing public IP address.

Property Value
Parameter group: IP Configuration Arguments
--tags

Space-separated tags: key[=value] [key[=value] ...]. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--vnet-name

Name of the virtual network.

Property Value
Parameter group: IP Configuration Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az network nic delete

Delete a network interface.

az network nic delete [--ids]
                      [--name]
                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                      [--resource-group]
                      [--subscription]

Examples

Delete a network interface.

az network nic delete -g MyResourceGroup -n MyNic

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the network interface (NIC).

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az network nic list

List network interfaces.

To list network interfaces attached to VMs in VM scale sets use az vmss nic list or az vmss nic list-vm-nics.

az network nic list [--max-items]
                    [--next-token]
                    [--resource-group]

Examples

List all NICs by internal DNS suffix.

az network nic list --query "[?dnsSettings.internalDomainNameSuffix=`{dnsSuffix}`]"

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

Property Value
Parameter group: Pagination Arguments
--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Property Value
Parameter group: Pagination Arguments
--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.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az network nic list-effective-nsg

List all effective network security groups applied to a network interface.

To learn more about troubleshooting using effective security rules visit https://learn.microsoft.com/en-us/azure/virtual-network/diagnose-network-traffic-filter-problem.

az network nic list-effective-nsg [--ids]
                                  [--name]
                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--resource-group]
                                  [--subscription]

Examples

List the effective security groups associated with a NIC.

az network nic list-effective-nsg -g MyResourceGroup -n MyNic

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the network interface (NIC).

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az network nic show

Get the details of a network interface.

az network nic show [--expand]
                    [--ids]
                    [--name]
                    [--resource-group]
                    [--subscription]

Examples

Get the internal domain name suffix of a NIC.

az network nic show -g MyResourceGroup -n MyNic --query "dnsSettings.internalDomainNameSuffix"

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

Expands referenced resources.

--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.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the network interface (NIC).

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az network nic show-effective-route-table

Show the effective route table applied to a network interface.

az network nic show-effective-route-table [--ids]
                                          [--name]
                                          [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                          [--resource-group]
                                          [--subscription]

Examples

Show the effective routes applied to a network interface.

az network nic show-effective-route-table -g MyResourceGroup -n MyNic

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--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.

Property Value
Parameter group: Resource Id Arguments
--name -n

Name of the network interface (NIC).

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az network nic update

Update a network interface.

az network nic update [--accelerated-networking {0, 1, f, false, n, no, t, true, y, yes}]
                      [--add]
                      [--auxiliary-mode {AcceleratedConnections, Floating, MaxConnections, None}]
                      [--auxiliary-sku {A1, A2, A4, A8, None}]
                      [--dns-servers]
                      [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                      [--ids]
                      [--internal-dns-name]
                      [--ip-configurations]
                      [--ip-forwarding {0, 1, f, false, n, no, t, true, y, yes}]
                      [--name]
                      [--network-security-group]
                      [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                      [--remove]
                      [--resource-group]
                      [--set]
                      [--subscription]

Examples

Update a network interface to use a different network security group.

az network nic update -g MyResourceGroup -n MyNic --network-security-group MyNewNsg

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--accelerated-networking

Whether to enable accelerated networking.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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>.

Property Value
Parameter group: Generic Update Arguments
--auxiliary-mode

Auxiliary mode of Network Interface resource.

Property Value
Parameter group: Properties Arguments
Accepted values: AcceleratedConnections, Floating, MaxConnections, None
--auxiliary-sku

Auxiliary sku of Network Interface resource.

Property Value
Parameter group: Properties Arguments
Accepted values: A1, A2, A4, A8, None
--dns-servers

Space-separated list of DNS server IP addresses. Use null to revert to default Azure servers. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: DNS Arguments
--force-string

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

Property Value
Parameter group: Generic Update Arguments
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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.

Property Value
Parameter group: Resource Id Arguments
--internal-dns-name

Name of internal DNS label.

Property Value
Parameter group: DNS Arguments
--ip-configurations

List of IP configurations of the network interface. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: Properties Arguments
--ip-forwarding

Whether to enable IP forwarding.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--name -n

Name of the network interface (NIC).

Property Value
Parameter group: Resource Id Arguments
--network-security-group

Name or ID of an existing network security group.

--no-wait

Do not wait for the long-running operation to finish.

Property Value
Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--remove

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

Property Value
Parameter group: Generic Update Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--set

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

Property Value
Parameter group: Generic Update Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False

az network nic wait

Place the CLI in a waiting state until a condition is met.

az network nic wait [--created]
                    [--custom]
                    [--deleted]
                    [--exists]
                    [--expand]
                    [--ids]
                    [--interval]
                    [--name]
                    [--resource-group]
                    [--subscription]
                    [--timeout]
                    [--updated]

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

Property Value
Parameter group: Wait Condition Arguments
--deleted

Wait until deleted.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--exists

Wait until the resource exists.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
--expand

Expands referenced resources.

--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.

Property Value
Parameter group: Resource Id Arguments
--interval

Polling interval in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 30
--name -n

Name of the network interface (NIC).

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

Property Value
Parameter group: Resource Id Arguments
--timeout

Maximum wait in seconds.

Property Value
Parameter group: Wait Condition Arguments
Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Property Value
Parameter group: Wait Condition Arguments
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

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

--verbose

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

Property Value
Default value: False