Virtual Hubs - Create Or Update
Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}?api-version=2025-05-01
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. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
virtual
|
path | True |
string |
The name of the VirtualHub. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| location |
string |
Resource location. |
| properties.addressPrefix |
string |
Address-prefix for this VirtualHub. |
| properties.allowBranchToBranchTraffic |
boolean |
Flag to control transit for VirtualRouter hub. |
| properties.azureFirewall |
The azureFirewall associated with this VirtualHub. |
|
| properties.expressRouteGateway |
The expressRouteGateway associated with this VirtualHub. |
|
| properties.hubRoutingPreference |
The hubRoutingPreference of this VirtualHub. |
|
| properties.p2SVpnGateway |
The P2SVpnGateway associated with this VirtualHub. |
|
| properties.preferredRoutingGateway |
The preferred gateway to route on-prem traffic |
|
| properties.routeTable |
The routeTable associated with this virtual hub. |
|
| properties.securityPartnerProvider |
The securityPartnerProvider associated with this VirtualHub. |
|
| properties.securityProviderName |
string |
The Security Provider name. |
| properties.sku |
string |
The sku of this VirtualHub. |
| properties.virtualHubRouteTableV2s |
List of all virtual hub route table v2s associated with this VirtualHub. |
|
| properties.virtualRouterAsn |
integer (int64) minimum: 0maximum: 4294967295 |
VirtualRouter ASN. |
| properties.virtualRouterAutoScaleConfiguration |
The VirtualHub Router autoscale configuration. |
|
| properties.virtualRouterIps |
string[] |
VirtualRouter IPs. |
| properties.virtualWan |
The VirtualWAN to which the VirtualHub belongs. |
|
| properties.vpnGateway |
The VpnGateway associated with this VirtualHub. |
|
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Resource 'VirtualHub' update operation succeeded |
|
| 201 Created |
Resource 'VirtualHub' 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
VirtualHubPut
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2?api-version=2025-05-01
{
"location": "West US",
"properties": {
"addressPrefix": "10.168.0.0/24",
"sku": "Basic",
"virtualWan": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"
}
},
"tags": {
"key1": "value1"
}
}
Sample response
{
"name": "virtualHub2",
"type": "Microsoft.Network/virtualHubs",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2",
"location": "West US",
"properties": {
"addressPrefix": "10.168.0.0/24",
"allowBranchToBranchTraffic": false,
"hubRoutingPreference": "ExpressRoute",
"preferredRoutingGateway": "ExpressRoute",
"provisioningState": "Succeeded",
"routingState": "Provisioned",
"sku": "Basic",
"virtualHubRouteTableV2s": [],
"virtualRouterAsn": 65515,
"virtualRouterAutoScaleConfiguration": {
"minCapacity": 2
},
"virtualRouterIps": [
"10.10.1.12",
"10.10.1.13"
],
"virtualWan": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"
}
}
}
{
"name": "virtualHub2",
"type": "Microsoft.Network/virtualHubs",
"etag": "w/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub2",
"location": "West US",
"properties": {
"addressPrefix": "10.168.0.0/24",
"allowBranchToBranchTraffic": false,
"hubRoutingPreference": "ExpressRoute",
"preferredRoutingGateway": "ExpressRoute",
"provisioningState": "Succeeded",
"routingState": "Provisioned",
"sku": "Basic",
"virtualHubRouteTableV2s": [],
"virtualRouterAsn": 65515,
"virtualRouterAutoScaleConfiguration": {
"minCapacity": 2
},
"virtualRouterIps": [
"10.10.1.12",
"10.10.1.13"
],
"virtualWan": {
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1"
}
}
}
Definitions
| Name | Description |
|---|---|
|
Cloud |
An error response from the service. |
|
Cloud |
An error response from the service. |
|
Hub |
The hub routing preference gateway types |
|
Preferred |
The preferred routing gateway types |
|
Provisioning |
Provisioning states of a resource. |
|
Routing |
The current routing state of the VirtualHub. |
|
Sub |
Reference to another subresource. |
|
Virtual |
VirtualHub Resource. |
|
Virtual |
VirtualHub route. |
|
Virtual |
VirtualHub route table. |
|
Virtual |
VirtualHubRouteTableV2 Resource. |
|
Virtual |
VirtualHubRouteTableV2 route. |
|
Virtual |
The VirtualHub Router autoscale configuration. |
CloudError
An error response from the service.
| Name | Type | Description |
|---|---|---|
| error |
Cloud error body. |
CloudErrorBody
An error response from the service.
| Name | Type | Description |
|---|---|---|
| code |
string |
An identifier for the error. Codes are invariant and are intended to be consumed programmatically. |
| details |
A list of additional details about the error. |
|
| message |
string |
A message describing the error, intended to be suitable for display in a user interface. |
| target |
string |
The target of the particular error. For example, the name of the property in error. |
HubRoutingPreference
The hub routing preference gateway types
| Value | Description |
|---|---|
| ExpressRoute |
ExpressRoute |
| VpnGateway |
VpnGateway |
| ASPath |
ASPath |
PreferredRoutingGateway
The preferred routing gateway types
| Value | Description |
|---|---|
| ExpressRoute |
ExpressRoute |
| VpnGateway |
VpnGateway |
| None |
None |
ProvisioningState
Provisioning states of a resource.
| Value | Description |
|---|---|
| Failed |
Failed |
| Succeeded |
Succeeded |
| Canceled |
Canceled |
| Creating |
Creating |
| Updating |
Updating |
| Deleting |
Deleting |
RoutingState
The current routing state of the VirtualHub.
| Value | Description |
|---|---|
| None |
None |
| Provisioned |
Provisioned |
| Provisioning |
Provisioning |
| Failed |
Failed |
SubResource
Reference to another subresource.
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
VirtualHub
VirtualHub Resource.
| Name | Type | Description |
|---|---|---|
| etag |
string |
A unique read-only string that changes whenever the resource is updated. |
| id |
string |
Resource ID. |
| kind |
string |
Kind of service virtual hub. This is metadata used for the Azure portal experience for Route Server. |
| location |
string |
Resource location. |
| name |
string |
Resource name. |
| properties.addressPrefix |
string |
Address-prefix for this VirtualHub. |
| properties.allowBranchToBranchTraffic |
boolean |
Flag to control transit for VirtualRouter hub. |
| properties.azureFirewall |
The azureFirewall associated with this VirtualHub. |
|
| properties.bgpConnections |
List of references to Bgp Connections. |
|
| properties.expressRouteGateway |
The expressRouteGateway associated with this VirtualHub. |
|
| properties.hubRoutingPreference |
The hubRoutingPreference of this VirtualHub. |
|
| properties.ipConfigurations |
List of references to IpConfigurations. |
|
| properties.p2SVpnGateway |
The P2SVpnGateway associated with this VirtualHub. |
|
| properties.preferredRoutingGateway |
The preferred gateway to route on-prem traffic |
|
| properties.provisioningState |
The provisioning state of the virtual hub resource. |
|
| properties.routeMaps |
List of references to RouteMaps. |
|
| properties.routeTable |
The routeTable associated with this virtual hub. |
|
| properties.routingState |
The routing state. |
|
| properties.securityPartnerProvider |
The securityPartnerProvider associated with this VirtualHub. |
|
| properties.securityProviderName |
string |
The Security Provider name. |
| properties.sku |
string |
The sku of this VirtualHub. |
| properties.virtualHubRouteTableV2s |
List of all virtual hub route table v2s associated with this VirtualHub. |
|
| properties.virtualRouterAsn |
integer (int64) minimum: 0maximum: 4294967295 |
VirtualRouter ASN. |
| properties.virtualRouterAutoScaleConfiguration |
The VirtualHub Router autoscale configuration. |
|
| properties.virtualRouterIps |
string[] |
VirtualRouter IPs. |
| properties.virtualWan |
The VirtualWAN to which the VirtualHub belongs. |
|
| properties.vpnGateway |
The VpnGateway associated with this VirtualHub. |
|
| tags |
object |
Resource tags. |
| type |
string |
Resource type. |
VirtualHubRoute
VirtualHub route.
| Name | Type | Description |
|---|---|---|
| addressPrefixes |
string[] |
List of all addressPrefixes. |
| nextHopIpAddress |
string |
NextHop ip address. |
VirtualHubRouteTable
VirtualHub route table.
| Name | Type | Description |
|---|---|---|
| routes |
List of all routes. |
VirtualHubRouteTableV2
VirtualHubRouteTableV2 Resource.
| Name | Type | Description |
|---|---|---|
| etag |
string |
A unique read-only string that changes whenever the resource is updated. |
| id |
string |
Resource ID. |
| name |
string |
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
| properties.attachedConnections |
string[] |
List of all connections attached to this route table v2. |
| properties.provisioningState |
The provisioning state of the virtual hub route table v2 resource. |
|
| properties.routes |
List of all routes. |
VirtualHubRouteV2
VirtualHubRouteTableV2 route.
| Name | Type | Description |
|---|---|---|
| destinationType |
string |
The type of destinations. |
| destinations |
string[] |
List of all destinations. |
| nextHopType |
string |
The type of next hops. |
| nextHops |
string[] |
NextHops ip address. |
VirtualRouterAutoScaleConfiguration
The VirtualHub Router autoscale configuration.
| Name | Type | Description |
|---|---|---|
| minCapacity |
integer (int32) minimum: 0 |
The minimum number of scale units for VirtualHub Router. |