az stack-hci-vm network vnet subnet
Note
This reference is part of the stack-hci-vm extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az stack-hci-vm network vnet subnet command. Learn more about extensions.
Manage subnets within a virtual network with stack-hci-vm.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az stack-hci-vm network vnet subnet create |
Create a subnet. |
Extension | GA |
| az stack-hci-vm network vnet subnet delete |
Delete a subnet. |
Extension | GA |
| az stack-hci-vm network vnet subnet list |
List all subnets in a virtual network. |
Extension | GA |
| az stack-hci-vm network vnet subnet show |
Get the details of a subnet. |
Extension | GA |
| az stack-hci-vm network vnet subnet update |
Update a subnet. |
Extension | GA |
az stack-hci-vm network vnet subnet create
Create a subnet.
az stack-hci-vm network vnet subnet create --address-prefix
--custom-location
--name
--resource-group
--vnet-name
[--location]
[--nat-gateway]
[--network-security-group]
[--polling-interval]
[--routes]
[--tags]
Examples
CreateSubnet
az stack-hci-vm network vnet subnet create --resource-group "test-rg" --vnet-name "test-vnet" --name "test-subnet" --location "eastus" --tags env=prod subnettype=backend --custom-location "/subscriptions/xxxx/resourceGroups/test-rg/providers/Microsoft.ExtendedLocation/customLocations/test-location" --address-prefix "10.0.0.0/24" --network-security-group "/subscriptions/xxxx/resourceGroups/test-rg/providers/Microsoft.Network/networkSecurityGroups/test-nsg" --nat-gateway "/subscriptions/xxxx/resourceGroups/test-rg/providers/Microsoft.Network/natGateways/test-nat" --routes '[{"name":"default","address_prefix":"0.0.0.0/0","next_hop_ip_address":"10.0.0.1"}]' --polling-interval 30
Required Parameters
Subnet CIDR (required).
The ID of the custom location.
Name of the virtual network subnet.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Name of the virtual network.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
If location is not specified, the location of the resource group is used.
Resource ID of the NAT Gateway to associate.
Resource ID of the Network Security Group to associate.
ARM polling interval for long running operations.
Collection of routes contained within a route table.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-hci-vm network vnet subnet delete
Delete a subnet.
az stack-hci-vm network vnet subnet delete --name
--resource-group
--vnet-name
[--polling-interval]
[--yes]
Examples
DeleteSubnet
az stack-hci-vm network vnet subnet delete --vnet-name "test-vnet" --name "test-subnet" --resource-group "test-rg" --yes
Required Parameters
Name of the virtual network subnet.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Name of the virtual network.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
ARM polling interval for long running operations.
Do not prompt for confirmation.
| Property | Value |
|---|---|
| Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-hci-vm network vnet subnet list
List all subnets in a virtual network.
az stack-hci-vm network vnet subnet list --vnet-name
[--resource-group]
Examples
ListSubnets
az stack-hci-vm network vnet subnet list --resource-group "test-rg" --vnet-name "test-vnet"
Required Parameters
Name of the virtual network.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-hci-vm network vnet subnet show
Get the details of a subnet.
az stack-hci-vm network vnet subnet show --name
--resource-group
--vnet-name
Examples
ShowSubnet
az stack-hci-vm network vnet subnet show --vnet-name "test-vnet" --name "test-subnet" --resource-group "test-rg"
Required Parameters
Name of the virtual network subnet.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Name of the virtual network.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |
az stack-hci-vm network vnet subnet update
Update a subnet.
az stack-hci-vm network vnet subnet update --name
--resource-group
--vnet-name
[--add]
[--force-string]
[--nat-gateway]
[--network-security-group]
[--remove]
[--set]
[--tags]
Examples
UpdateSubnet
az stack-hci-vm network vnet subnet update --resource-group "test-rg" --vnet-name "test-vnet" --name "test-subnet" --network-security-group "/subscriptions/xxxx/resourceGroups/test-rg/providers/Microsoft.Network/networkSecurityGroups/test-nsg" --nat-gateway "/subscriptions/xxxx/resourceGroups/test-rg/providers/Microsoft.Network/natGateways/test-nat" --tags env=prod updated=yes
Required Parameters
Name of the virtual network subnet.
Name of resource group. You can configure the default group using az configure --defaults group=<name>.
Name of the virtual network.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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 |
| Default value: | [] |
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
| Default value: | False |
Resource ID of the NAT Gateway to associate.
Resource ID of the Network Security Group to associate.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
| Default value: | [] |
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.
| Property | Value |
|---|---|
| Parameter group: | Generic Update Arguments |
| Default value: | [] |
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |