Route Maps - Create Or Update
Creates a RouteMap if it doesn't exist else updates the existing one.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}?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. |
|
route
|
path | True |
string |
The name of the resource that is unique within a resource group. This name can be used to access the resource. |
|
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 |
|---|---|---|
| properties.associatedInboundConnections |
string[] |
List of connections which have this RoutMap associated for inbound traffic. |
| properties.associatedOutboundConnections |
string[] |
List of connections which have this RoutMap associated for outbound traffic. |
| properties.rules |
List of RouteMap rules to be applied. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Resource 'RouteMap' update operation succeeded |
|
| 201 Created |
Resource 'RouteMap' 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
RouteMapPut
Sample request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1?api-version=2025-05-01
{
"properties": {
"associatedInboundConnections": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"
],
"associatedOutboundConnections": [],
"rules": [
{
"name": "rule1",
"actions": [
{
"type": "Add",
"parameters": [
{
"asPath": [
"22334"
],
"community": [],
"routePrefix": []
}
]
}
],
"matchCriteria": [
{
"asPath": [],
"community": [],
"matchCondition": "Contains",
"routePrefix": [
"10.0.0.0/8"
]
}
],
"nextStepIfMatched": "Continue"
}
]
}
}
Sample response
{
"name": "routeMap1",
"type": "Microsoft.Network/virtualHubs/routeMaps",
"etag": "W/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1",
"properties": {
"associatedInboundConnections": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"
],
"associatedOutboundConnections": [],
"provisioningState": "Succeeded",
"rules": [
{
"name": "rule1",
"actions": [
{
"type": "Add",
"parameters": [
{
"asPath": [
"22334"
],
"community": [],
"routePrefix": []
}
]
}
],
"matchCriteria": [
{
"asPath": [],
"community": [],
"matchCondition": "Contains",
"routePrefix": [
"10.0.0.0/8"
]
}
],
"nextStepIfMatched": "Continue"
}
]
}
}
{
"name": "routeMap1",
"type": "Microsoft.Network/virtualHubs/routeMaps",
"etag": "W/\\00000000-0000-0000-0000-000000000000\\",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/routeMaps/routeMap1",
"properties": {
"associatedInboundConnections": [
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Network/expressRouteGateways/exrGateway1/expressRouteConnections/exrConn1"
],
"associatedOutboundConnections": [],
"provisioningState": "Succeeded",
"rules": [
{
"name": "rule1",
"actions": [
{
"type": "Add",
"parameters": [
{
"asPath": [
"22334"
],
"community": [],
"routePrefix": []
}
]
}
],
"matchCriteria": [
{
"asPath": [],
"community": [],
"matchCondition": "Contains",
"routePrefix": [
"10.0.0.0/8"
]
}
],
"nextStepIfMatched": "Continue"
}
]
}
}
Definitions
| Name | Description |
|---|---|
| Action |
Action to be taken on a route matching a RouteMap criterion. |
|
Common. |
An error response from the service. |
|
Common. |
An error response from the service. |
| Criterion |
A matching criteria which matches routes based on route prefix, community, and AS path. |
|
Next |
Supported next step behaviors after a rule is applied to a matched route |
| Parameter |
Parameters for an Action. |
|
Provisioning |
The provisioning state of the resource. |
|
Route |
The RouteMap child resource of a Virtual hub. |
|
Route |
Kind of actions which can be taken on a matched route. Add, Replace, Remove refer to parameters on the route, like community or prefix |
|
Route |
Match condition to apply RouteMap rules. |
|
Route |
A RouteMap Rule. |
Action
Action to be taken on a route matching a RouteMap criterion.
| Name | Type | Description |
|---|---|---|
| parameters |
List of parameters relevant to the action.For instance if type is drop then parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be added |
|
| type |
Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.' |
Common.CloudError
An error response from the service.
| Name | Type | Description |
|---|---|---|
| error |
Cloud error body. |
Common.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. |
Criterion
A matching criteria which matches routes based on route prefix, community, and AS path.
| Name | Type | Description |
|---|---|---|
| asPath |
string[] |
List of AS paths which this criteria matches. |
| community |
string[] |
List of BGP communities which this criteria matches. |
| matchCondition |
Match condition to apply RouteMap rules. |
|
| routePrefix |
string[] |
List of route prefixes which this criteria matches. |
NextStep
Supported next step behaviors after a rule is applied to a matched route
| Value | Description |
|---|---|
| Unknown |
Unknown |
| Continue |
Continue |
| Terminate |
Terminate |
Parameter
Parameters for an Action.
| Name | Type | Description |
|---|---|---|
| asPath |
string[] |
List of AS paths. |
| community |
string[] |
List of BGP communities. |
| routePrefix |
string[] |
List of route prefixes. |
ProvisioningState
The provisioning state of the resource.
| Value | Description |
|---|---|
| Failed |
Failed |
| Succeeded |
Succeeded |
| Canceled |
Canceled |
| Creating |
Creating |
| Updating |
Updating |
| Deleting |
Deleting |
RouteMap
The RouteMap child resource of a Virtual hub.
| Name | Type | Description |
|---|---|---|
| etag |
string |
A unique read-only string that changes whenever the resource is updated. |
| id |
string |
Resource ID. |
| name |
string |
Name of the resource. |
| properties.associatedInboundConnections |
string[] |
List of connections which have this RoutMap associated for inbound traffic. |
| properties.associatedOutboundConnections |
string[] |
List of connections which have this RoutMap associated for outbound traffic. |
| properties.provisioningState |
The provisioning state of the RouteMap resource. |
|
| properties.rules |
List of RouteMap rules to be applied. |
|
| type |
string |
Type of the resource. |
RouteMapActionType
Kind of actions which can be taken on a matched route. Add, Replace, Remove refer to parameters on the route, like community or prefix
| Value | Description |
|---|---|
| Unknown |
Unknown |
| Remove |
Remove |
| Add |
Add |
| Replace |
Replace |
| Drop |
Drop |
RouteMapMatchCondition
Match condition to apply RouteMap rules.
| Value | Description |
|---|---|
| Unknown |
Unknown |
| Contains |
Contains |
| Equals |
Equals |
| NotContains |
NotContains |
| NotEquals |
NotEquals |
RouteMapRule
A RouteMap Rule.
| Name | Type | Description |
|---|---|---|
| actions |
Action[] |
List of actions which will be applied on a match. |
| matchCriteria |
List of matching criterion which will be applied to traffic. |
|
| name |
string |
The unique name for the rule. |
| nextStepIfMatched |
Next step after rule is evaluated. Current supported behaviors are 'Continue'(to next rule) and 'Terminate'. |