ExpressRouteGateway - effective routes (virtual hub)

Peter Stieber 265 Reputation points
2025-08-12T08:43:42.1766667+00:00

Is there a way to get effective routes via API for express route gateway deployed in virtual hub ?

Azure Virtual WAN
Azure Virtual WAN
An Azure virtual networking service that provides optimized and automated branch-to-branch connectivity.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Thanmayi Godithi 1,885 Reputation points Microsoft External Staff Moderator
    2025-08-12T12:02:05.21+00:00

    Hi @Peter Stieber,

    Thank you for reaching out on Microsoft Q&A forum.

    I understand you want to know if it’s possible to retrieve effective routes for an ExpressRoute gateway deployed in a Virtual Hub using an API.

    Yes — Azure provides a public REST API called GetEffectiveVirtualHubRoutes, which allows you to query the effective routes for specific resources inside a Virtual Hub, including an ExpressRoute connection. This API returns the actual computed routes that the Virtual WAN fabric applies, combining both your configured static routes and dynamically learned routes via BGP. It’s useful for verifying routing behaviour, troubleshooting connectivity, and validating route propagation in complex hybrid environments.

    To use this API for an ExpressRoute connection, you submit a POST request to the effectiveRoutes endpoint of your Virtual Hub, specifying the resource ID of your ExpressRoute connection and the resource type (ExpressRouteConnection).

    Example request:

    POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualHubs/virtualHub1/effectiveRoutes?api-version=2024-05-01
    {
      "resourceId": "/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayName/expressRouteConnections/connectionName",
      "virtualWanResourceType": "ExpressRouteConnection"
    }
    

    The response will include details such as:

    • Route prefixes (e.g., 10.10.0.0/16)
    • Next hop IPs
    • AS paths for BGP-learned routes
    • Route sources (e.g., Static, BGP)
    • Propagated route table and policy details

    Reference: Get Effective Virtual Hub Routes – REST API

    Kindly let us know if you have any additional questions.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.