az network nic

Manage network interfaces.

Commands

Name Description Type Status
az network nic create

Create a network interface.

Core Preview
az network nic delete

Delete a network interface.

Core Preview
az network nic list

List network interfaces.

Core Preview
az network nic show

Show details for a network interface.

Core Preview

az network nic create

Preview

Create a network interface.

Create a network interface with a single IP configuration in an existing subnet. Pass --subnet as a subnet resource id, or as a subnet name together with --vnet-name. The IP configuration is named ipconfig1 and gets a dynamically allocated private IP address unless --private-ip-address is supplied, in which case the allocation is Static. --public-ip-address and --network-security-group accept a name in the same resource group or a full resource id.

az network nic create --location
                      --name
                      --resource-group
                      --subnet
                      [--accelerated-networking]
                      [--dns-servers]
                      [--edge-zone]
                      [--internal-dns-name]
                      [--ip-forwarding]
                      [--network-security-group]
                      [--private-ip-address]
                      [--private-ip-address-version {IPv4, IPv6}]
                      [--profile]
                      [--public-ip-address]
                      [--subscription-id]
                      [--tags]
                      [--vnet-name]

Examples

Create a network interface in a subnet

az network nic create --name mynic --resource-group myrg --location eastus --vnet-name myvnet --subnet default

Create a network interface from a subnet resource id

az network nic create --name mynic --resource-group myrg --location eastus --subnet /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/default

Create a network interface with a public IP address and a network security group

az network nic create --name mynic --resource-group myrg --location eastus --vnet-name myvnet --subnet default \
    --public-ip-address mypip --network-security-group mynsg

Create a network interface with a static private IP address

az network nic create --name mynic --resource-group myrg --location eastus --vnet-name myvnet --subnet default \
    --private-ip-address 10.0.0.10

Create a network interface with accelerated networking, custom DNS servers and tags

az network nic create --name mynic --resource-group myrg --location eastus --vnet-name myvnet --subnet default \
    --accelerated-networking --dns-servers 10.0.0.4 10.0.0.5 --tags owner=team-a costCenter=42

Required Parameters

--location -l

Location for the network interface.

--name -n

The name of the network interface.

--resource-group -g

The resource group name.

--subnet

Name or resource id of an existing subnet. A name requires --vnet-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.

--accelerated-networking

Enable accelerated networking.

--dns-servers

DNS server IP addresses for the network interface.

--edge-zone

Name of the edge zone (extended location) to create the network interface in.

--internal-dns-name

The internal DNS name label.

--ip-forwarding

Enable IP forwarding.

--network-security-group

Name or resource id of an existing network security group to associate.

--private-ip-address

Static private IP address to use. A dynamic address is allocated when omitted.

--private-ip-address-version

Version of the private IP address. Defaults to IPv4.

Property Value
Accepted values: IPv4, IPv6
--profile

Use the named profile for this command (overrides the active profile).

--public-ip-address

Name or resource id of an existing public IP address to associate.

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

--tags

Resource tags in KEY[=VALUE] form (space-separated); a bare KEY sets an empty value.

--vnet-name

Name of the virtual network that contains the subnet, when --subnet is a name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

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

JMESPath query string to filter/project the command result before rendering.

az network nic delete

Preview

Delete a network interface.

Delete the named network interface. The delete fails while the interface is still attached to a virtual machine, so detach it or delete the virtual machine first.

az network nic delete --name
                      --resource-group
                      [--profile]
                      [--subscription-id]

Examples

Delete a network interface

az network nic delete --name mynic --resource-group myrg

Required Parameters

--name -n

The name of the network interface.

--resource-group -g

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.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

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

JMESPath query string to filter/project the command result before rendering.

az network nic list

Preview

List network interfaces.

List network interfaces in a resource group, or across the whole subscription when --resource-group is omitted.

az network nic list [--profile]
                    [--resource-group]
                    [--subscription-id]

Examples

List the network interfaces in a resource group

az network nic list --resource-group myrg

List every network interface in the subscription

az network nic list --subscription-id $subId

Optional Parameters

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

--profile

Use the named profile for this command (overrides the active profile).

--resource-group -g

The resource group name. Omit to list every network interface in the subscription.

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

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

JMESPath query string to filter/project the command result before rendering.

az network nic show

Preview

Show details for a network interface.

Retrieve the full definition of a single network interface, including its IP configurations, DNS settings, MAC address and provisioning state. Use --expand to inline referenced sub-resources.

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

Examples

Show a network interface

az network nic show --name mynic --resource-group myrg

Show using shell variables

az network nic show --name $nicName --resource-group $rg --subscription-id $subId

Show a network interface with its public IP address expanded

az network nic show --name mynic --resource-group myrg --expand ipConfigurations/publicIPAddress

Required Parameters

--name -n

The name of the network interface.

--resource-group -g

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

Expand referenced resources, e.g. ipConfigurations/publicIPAddress.

--profile

Use the named profile for this command (overrides the active profile).

--subscription-id

Azure Subscription Id. Defaults to the active profile's subscription.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

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

JMESPath query string to filter/project the command result before rendering.