Share via


az azurestackhci virtualnetwork

Note

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

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage virtualnetwork with azurestackhci.

Commands

Name Description Type Status
az azurestackhci virtualnetwork create

Create a virtual network.

Extension Experimental
az azurestackhci virtualnetwork delete

Delete a virtual network.

Extension Experimental
az azurestackhci virtualnetwork list

List all the virtual networks.

Extension Experimental
az azurestackhci virtualnetwork show

Get the details of a virtual network.

Extension Experimental
az azurestackhci virtualnetwork update

Update a virtual network.

Extension Experimental

az azurestackhci virtualnetwork create

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a virtual network.

az azurestackhci virtualnetwork create --name
                                       --resource-group
                                       [--address-prefix]
                                       [--dns-servers]
                                       [--extended-location]
                                       [--gateway]
                                       [--ip-allocation-method]
                                       [--location]
                                       [--network-type]
                                       [--routes]
                                       [--subnets]
                                       [--tags]
                                       [--vlan]
                                       [--vm-switch-name]

Examples

PutVirtualNetwork

az azurestackhci virtualnetwork create --resource-group "test-rg" --extended-location name="/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location" type="CustomLocation" --location "West US2" --network-type "Transparent" --name "test-vnet" --ip-allocation-method "Static" --address-prefix "10.0.0.0/28" --vm-switch-name "test-vm-switch" --dns-servers 10.220.32.16 10.220.32.17

Required Parameters

--name

Name of the virtual network.

--resource-group -g

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

Optional Parameters

--address-prefix

Cidr for this subnet - IPv4, IPv6.

Usage: --address-prefix "1.2.3.0/16".

--dns-servers

Space-separated list of DNS server IP addresses.

Usage: --dns-servers 10.220.32.16 10.220.32.17.

--extended-location

Usage: --extended-location type=XX name=XX

type: The extended location type. name: The extended location name.

--gateway

Gateway.

Usage: --gateway 1.2.3.4.

--ip-allocation-method

IPAllocationMethod - The IP address allocation method. Possible values include: Static, Dynamic.

Usage: --ip-allocation-method "Static/Dynamic".

--location -l

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

--network-type

Type of the network.

--routes

Collection of routes contained within a route table.

Usage: --routes '[{/"name/":/"route1/",/"properties/":{/"address_prefix/":/"1.2.3.0/28/",/"next_hop_ip_address/":/"1.2.3.1/"}},{/"name/":/"route2/",/"properties/":{/"address_prefix/":/"1.2.6.0/24/",/"next_hop_ip_address/":/"1.2.6.1/"}}]' Expected value: json-string/json-file/@json-file.

--subnets

Subnet - list of subnets under the virtual network. All other subnet properties in the cli parameters will be ignored if this is provided. Expected value: json-string/@json-file.

Usage: --subnets '[{"properties":{"addressPrefix":"1.2.3.0/24","ipAllocationMethod":"Static"}}]'.

--tags

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

--vlan

Vlan to use for the subnet.

Usage: --vlan 10.

default value: 0
--vm-switch-name

Name of the VM switch.

Usage: --vm-switch-name "vm-switch-01".

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 azurestackhci virtualnetwork delete

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a virtual network.

az azurestackhci virtualnetwork delete [--ids]
                                       [--name]
                                       [--resource-group]
                                       [--subscription]
                                       [--yes]

Examples

DeleteVirtualNetwork

az azurestackhci virtualnetwork delete --resource-group "test-rg" --name "test-vnet"

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

Name of the virtual network.

--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 azurestackhci virtualnetwork list

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all the virtual networks.

az azurestackhci virtualnetwork list [--resource-group]

Examples

ListVirtualNetworkByResourceGroup

az azurestackhci virtualnetwork list --resource-group "test-rg"

ListVirtualNetworkBySubscription

az azurestackhci virtualnetwork list

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 azurestackhci virtualnetwork show

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get the details of a virtual network.

az azurestackhci virtualnetwork show [--ids]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]

Examples

GetVirtualNetwork

az azurestackhci virtualnetwork show --resource-group "test-rg" --name "test-vnet"

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

Name of the virtual network.

--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 azurestackhci virtualnetwork update

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a virtual network.

az azurestackhci virtualnetwork update [--ids]
                                       [--name]
                                       [--resource-group]
                                       [--subscription]
                                       [--tags]

Examples

UpdateVirtualNetwork

az azurestackhci virtualnetwork update --resource-group "test-rg" --tags additionalProperties="sample" --name "test-vnet"

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

Name of the virtual network.

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

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