Share via


az vm nic

Manage network interfaces. See also az network nic.

A network interface (NIC) is the interconnection between a VM and the underlying software network. For more information, see https://docs.microsoft.com/azure/virtual-network/virtual-network-network-interface-overview.

Commands

Name Description Type Status
az vm nic add

Add existing NICs to a VM.

Core GA
az vm nic list

List the NICs available on a VM.

Core GA
az vm nic remove

Remove NICs from a VM.

Core GA
az vm nic set

Configure settings of a NIC attached to a VM.

Core GA
az vm nic show

Display information for a NIC attached to a VM.

Core GA

az vm nic add

Add existing NICs to a VM.

az vm nic add --nics
              --resource-group
              --vm-name
              [--primary-nic]

Examples

Add two NICs to a VM.

az vm nic add -g MyResourceGroup --vm-name MyVm --nics nic_name1 nic_name2

Required Parameters

--nics

Names or IDs of NICs.

--resource-group -g

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

--vm-name

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>.

Optional Parameters

--primary-nic

Name or ID of the primary NIC. If missing, the first NIC in the list will be the primary.

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 vm nic list

List the NICs available on a VM.

az vm nic list --resource-group
               --vm-name

Examples

List all of the NICs on a VM.

az vm nic list -g MyResourceGroup --vm-name MyVm

Required Parameters

--resource-group -g

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

--vm-name

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<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 vm nic remove

Remove NICs from a VM.

az vm nic remove --nics
                 --resource-group
                 --vm-name
                 [--primary-nic]

Examples

Remove two NICs from a VM.

az vm nic remove -g MyResourceGroup --vm-name MyVm --nics nic_name1 nic_name2

Required Parameters

--nics

Names or IDs of NICs.

--resource-group -g

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

--vm-name

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>.

Optional Parameters

--primary-nic

Name or ID of the primary NIC. If missing, the first NIC in the list will be the primary.

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 vm nic set

Configure settings of a NIC attached to a VM.

az vm nic set --nics
              --resource-group
              --vm-name
              [--primary-nic]

Examples

Set a NIC on a VM to be the primary interface.

az vm nic set -g MyResourceGroup --vm-name MyVm --nic nic_name1 nic_name2 --primary-nic nic_name2

Configure settings of a NIC attached to a VM. (autogenerated)

az vm nic set --nics nic_name1 nic_name2 --primary-nic nic_name2 --resource-group MyResourceGroup --vm-name MyVm

Required Parameters

--nics

Names or IDs of NICs.

--resource-group -g

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

--vm-name

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>.

Optional Parameters

--primary-nic

Name or ID of the primary NIC. If missing, the first NIC in the list will be the primary.

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 vm nic show

Display information for a NIC attached to a VM.

az vm nic show --nic
               --resource-group
               --vm-name

Examples

Show details of a NIC on a VM.

az vm nic show -g MyResourceGroup --vm-name MyVm --nic nic_name1

Required Parameters

--nic

NIC name or ID.

--resource-group -g

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

--vm-name

The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<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.