Share via

Virtual Hub Route Selection Algorithm - Where does routingWeight fit in?

Peter Stieber 65 Reputation points
2026-02-23T16:42:37.1666667+00:00

Hi,

I was reading the official documentation on the Virtual Hub Route Selection Algorithm and noticed that routingWeight (configurable per ExpressRoute/VPN connection on the virtual hub) is not mentioned anywhere in the documented selection steps.

The documented algorithm is:

  1. Longest Prefix Match
  2. Static routes preferred over BGP
  3. Hub routing preference (ExpressRoute / VPN / AS Path)
  4. Shortest BGP AS-Path length

Where does routingWeight fit in this?

Scenario 1 - HRP set to ExpressRoute or VPN: If I have two local ExpressRoute connections on the same hub, both advertising the same prefix with the same AS-Path length, will the one with higher routingWeight be preferred? Does it act like BGP Local Preference and kick in before AS-Path comparison?

Scenario 2 - HRP set to AS Path: Since AS Path mode prioritizes shortest AS-Path length first, does routingWeight still apply? For example if two connections have the same AS-Path length, does routingWeight break the tie — or is it completely ignored when HRP is set to AS Path?

The parameter is configurable and clearly has an impact on routing decisions, so it would be great if the docs could be updated to explicitly include it as a step in the algorithm and clarify whether its behavior changes depending on the selected HRP mode.

Thanks

Azure ExpressRoute
Azure ExpressRoute

An Azure service that provides private connections between Azure datacenters and infrastructure, either on premises or in a colocation environment.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vallepu Venkateswarlu 6,130 Reputation points Microsoft External Staff Moderator
    2026-02-23T17:09:09.29+00:00

    Hi @ Peter Stieber,

    Welcome to Microsoft Q&A Platform.

    It looks like you're diving deep into the Virtual Hub Route Selection Algorithm and have some good questions about how routingWeight fits into the picture. Here’s a breakdown of your queries regarding routingWeight and its impact based on the scenarios you mentioned:

    Scenario 1: HRP set to ExpressRoute or VPN

    If you have two local ExpressRoute connections advertising the same prefix with the same AS-Path length, the one with the higher routingWeight should be preferred. In this case, routingWeight behaves similarly to BGP Local Preference, effectively taking precedence over the AS-Path comparison when it comes to choosing a route.

    Scenario 2: HRP set to AS Path

    When HRP is set to AS Path, the selection process prioritizes routes based on the shortest AS-Path length. However, if there’s a tie in AS-Path length, routingWeight comes into play as a tie-breaker. So, it doesn’t get completely ignored; instead, it can influence the final decision between equally competing routes.

    This nuance indicates that it might be worthwhile to update the documentation to reflect how routingWeight impacts decision-making in different HRP configurations.

    Recommendations

    1. Documentation Feedback: Since you mentioned that the parameter is impactful but not noted in the selection steps, it could be beneficial to provide feedback to the Azure documentation team for clarity.
    2. Testing: You might consider setting up a test with two ExpressRoute connections to verify how routingWeight affects routing decisions in practice.

    References

    Please210246-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    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.