Virtual Network Subnets - Create Or Update
The operation to create or update a virtual network subnet.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}?api-version=2026-04-01-preview
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subnet
|
path | True |
string pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ |
Name of the virtual network subnet |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
virtual
|
path | True |
string pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$ |
Name of the virtual network |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| extendedLocation |
The extendedLocation of the resource. |
|
| properties |
The resource-specific properties for this resource. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Resource 'VirtualNetworkSubnet' update operation succeeded |
|
| 201 Created |
Resource 'VirtualNetworkSubnet' create operation succeeded Headers
|
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
PutVirtualNetworkSubnet
Sample request
PUT https://management.azure.com/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/test-rg/providers/Microsoft.AzureStackHCI/virtualNetworks/test-vnet/subnets/subnet1?api-version=2026-04-01-preview
{
"properties": {
"addressPrefix": "10.0.0.0/28"
}
}
Sample response
{
"name": "subnet",
"type": "Microsoft.AzureStackHCI/virtualNetworks/subnets",
"extendedLocation": {
"name": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
"type": "CustomLocation"
},
"id": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualNetworks/test-vnet/subnets/subnet1",
"properties": {
"addressPrefix": "10.0.0.0/28",
"provisioningState": "Accepted"
}
}
{
"name": "test-vnet",
"type": "Microsoft.AzureStackHCI/virtualNetworks",
"extendedLocation": {
"name": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
"type": "CustomLocation"
},
"id": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualNetworks/test-vnet/subnets/subnet1",
"properties": {
"addressPrefix": "10.0.0.0/28",
"provisioningState": "Succeeded"
}
}
Definitions
| Name | Description |
|---|---|
|
created |
The type of identity that created the resource. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Extended |
The complex type of the extended location. |
|
Extended |
The type of extendedLocation. |
|
Nat |
The ARM ID for a Network Security Group. |
|
Network |
The Azure Resource ID for a Network Security Group. |
|
Provisioning |
Provisioning state of the resource. |
| Route |
Route - Route resource. |
|
Route |
Route table resource. |
| Status |
The status of the operation performed on the resource [Succeeded, Failed, InProgress] |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
Virtual |
The virtual network resource definition. |
|
Virtual |
The Azure Resource ID for a resource consuming IP on a subnet |
|
Virtual |
VirtualNetwork subnet resource |
|
Virtual |
Status of virtual network subnet operations |
|
Virtual |
Status of virtual network subnet operations |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
ExtendedLocation
The complex type of the extended location.
| Name | Type | Description |
|---|---|---|
| name |
string |
The name of the extended location. |
| type |
The type of the extended location. |
ExtendedLocationTypes
The type of extendedLocation.
| Value | Description |
|---|---|
| CustomLocation |
Custom extended location type |
NatGatewayArmReference
The ARM ID for a Network Security Group.
| Name | Type | Description |
|---|---|---|
| resourceId |
string (arm-id) |
The ARM ID for a Network Security Group. |
NetworkSecurityGroupArmReference
The Azure Resource ID for a Network Security Group.
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
The Azure Resource ID for a Network Security Group. |
ProvisioningStateEnum
Provisioning state of the resource.
| Value | Description |
|---|---|
| Succeeded |
Provisioning has succeeded |
| Failed |
Provisioning has failed |
| InProgress |
Provisioning is in progress |
| Accepted |
Provisioning has been accepted |
| Deleting |
Deletion of the resource is in progress |
| Canceled |
Provisioning has been canceled |
Route
Route - Route resource.
| Name | Type | Description |
|---|---|---|
| name |
string pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$ |
Name - name of the subnet |
| properties.addressPrefix |
string |
The destination CIDR to which the route applies. |
| properties.nextHopIpAddress |
string |
The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop type is VirtualAppliance. |
RouteTable
Route table resource.
| Name | Type | Description |
|---|---|---|
| etag |
string |
A unique read-only string that changes whenever the resource is updated. |
| name |
string |
Resource name. |
| properties.routes |
Route[] |
Collection of routes contained within a route table. |
| type |
string |
Resource type. |
Status
The status of the operation performed on the resource [Succeeded, Failed, InProgress]
| Value | Description |
|---|---|
| Succeeded |
Operation succeeded |
| Failed |
Operation failed |
| InProgress |
Operation is in progress |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
VirtualNetworkSubnet
The virtual network resource definition.
| Name | Type | Description |
|---|---|---|
| extendedLocation |
The extendedLocation of the resource. |
|
| id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| name |
string |
The name of the resource |
| properties |
The resource-specific properties for this resource. |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
VirtualNetworkSubnetIpConfigurationReference
The Azure Resource ID for a resource consuming IP on a subnet
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
The Azure Resource ID for a Network Interface. |
VirtualNetworkSubnetProperties
VirtualNetwork subnet resource
| Name | Type | Description |
|---|---|---|
| addressPrefix |
string |
Subnet CIDR |
| ipConfigurations |
List of ip configurations for the subnet |
|
| natGateway |
Nat Gateway attached to the subnet for non-vnet traffic. |
|
| networkSecurityGroup |
Network Security Group attached to the subnet. |
|
| provisioningState |
The provisioning state of the virtual network subnet resource. |
|
| routeTable |
RouteTable defining custom routes for the subnet. |
|
| status |
The observed status of the virtual network subnet resource. |
VirtualNetworkSubnetStatus
Status of virtual network subnet operations
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
VirtualNetworkSubnet provisioning error code |
| errorMessage |
string |
Descriptive error message |
| provisioningStatus |
Public IP provisioning status |
VirtualNetworkSubnetStatusProvisioningStatus
Status of virtual network subnet operations
| Name | Type | Description |
|---|---|---|
| operationId |
string |
The ID of the operation performed on the virtual network subnet |
| status |
The status of the operation performed on the virtual network subnet [Succeeded, Failed, InProgress] |