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
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 for the network interface.
The name of the network interface.
The resource group name.
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.
Enable accelerated networking.
DNS server IP addresses for the network interface.
Name of the edge zone (extended location) to create the network interface in.
The internal DNS name label.
Enable IP forwarding.
Name or resource id of an existing network security group to associate.
Static private IP address to use. A dynamic address is allocated when omitted.
Version of the private IP address. Defaults to IPv4.
| Property | Value |
|---|---|
| Accepted values: | IPv4, IPv6 |
Use the named profile for this command (overrides the active profile).
Name or resource id of an existing public IP address to associate.
Azure Subscription Id. Defaults to the active profile's subscription.
Resource tags in KEY[=VALUE] form (space-separated); a bare KEY sets an empty value.
Name of the virtual network that contains the subnet, when --subnet is a name.
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 nic delete
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
The name of the network interface.
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 nic list
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.
Use the named profile for this command (overrides the active profile).
The resource group name. Omit to list every network interface 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 nic show
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
The name of the network interface.
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. ipConfigurations/publicIPAddress.
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.