Skip to content

Add RoutingConfiguration support for RouteServerPeer and VirtualNetworkGateway Connections - #29910

Open
irramtir wants to merge 8 commits into
Azure:mainfrom
irramtir:irramtir/RouteMapsForRouteServer
Open

Add RoutingConfiguration support for RouteServerPeer and VirtualNetworkGateway Connections#29910
irramtir wants to merge 8 commits into
Azure:mainfrom
irramtir:irramtir/RouteMapsForRouteServer

Conversation

@irramtir

Copy link
Copy Markdown

Description

Add optional parameter routingConfiguration to virtualNEtworkGatewayConnectio, BgpConnection and RouteSErverPeer which is a derived resource from bgpConnection
Swagger change: Azure/azure-rest-api-specs#42409

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

iramtirth and others added 7 commits May 14, 2026 11:46
…rkGatewayConnection

- Added RoutingConfiguration, VirtualHubVnetConnection, and VirtualHubVnetConnectionId parameters to Add-AzRouteServerPeer and Update-AzRouteServerPeer
- Added RoutingConfiguration parameter to New-AzVirtualNetworkGatewayConnection and Set-AzVirtualNetworkGatewayConnection
- Updated PSBgpConnection, PSRouteServerPeer, PSRouteServer, PSVirtualNetworkGatewayConnection models
- Added scenario tests for RouteServerPeer and VirtualNetworkGatewayConnection with RoutingConfiguration
- Updated help documentation for all affected cmdlets
…mutual exclusion validation, bounded polling loops
Copilot AI review requested due to automatic review settings July 27, 2026 23:09
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

a0x1ab commented Jul 27, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Az.Network module’s Route Server peer and Virtual Network Gateway connection cmdlets/models to support RoutingConfiguration, aligning Azure PowerShell with the referenced swagger updates.

Changes:

  • Added -RoutingConfiguration support to New-AzVirtualNetworkGatewayConnection and Set-AzVirtualNetworkGatewayConnection.
  • Added -RoutingConfiguration plus hub vnet connection association parameters to Add-AzRouteServerPeer and Update-AzRouteServerPeer, and surfaced the corresponding properties on returned objects.
  • Updated help docs, changelog, and scenario tests for the new capabilities.

Reviewed changes

Copilot reviewed 15 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Network/Network/VirtualNetworkGatewayConnection/UpdateAzureVirtualNetworkGatewayConnectionCommand.cs Adds -RoutingConfiguration parameter handling for Set/Update VNet gateway connections.
src/Network/Network/VirtualNetworkGatewayConnection/NewAzureVirtualNetworkGatewayConnectionCommand.cs Adds -RoutingConfiguration parameter handling for New VNet gateway connections.
src/Network/Network/RouteServerPeer/UpdateAzureRMRouteServerPeerCommand.cs Adds routing configuration + hub vnet connection update support for route server peers.
src/Network/Network/RouteServerPeer/AddAzureRMRouteServerPeerCommand.cs Adds routing configuration + hub vnet connection create support for route server peers.
src/Network/Network/Models/PSVirtualNetworkGatewayConnection.cs Exposes RoutingConfiguration on the PS model (plus text serialization helper).
src/Network/Network/help/Update-AzRouteServerPeer.md Documents new parameters for Update-AzRouteServerPeer.
src/Network/Network/help/Set-AzVirtualNetworkGatewayConnection.md Documents new -RoutingConfiguration parameter for Set-AzVirtualNetworkGatewayConnection.
src/Network/Network/help/New-AzVirtualNetworkGatewayConnection.md Documents new -RoutingConfiguration parameter for New-AzVirtualNetworkGatewayConnection.
src/Network/Network/help/Add-AzRouteServerPeer.md Documents new parameters for Add-AzRouteServerPeer.
src/Network/Network/Generated/Models/PSRouteServerPeer.cs Surfaces routing configuration and hub vnet connection on peer model.
src/Network/Network/Generated/Models/PSRouteServer.cs Propagates new peer properties when projecting route server output.
src/Network/Network/Generated/Models/PSBgpConnection.cs Surfaces RoutingConfiguration on BGP connection PS model.
src/Network/Network/Cortex/VHubRouteTable/NewAzureRmRoutingConfigurationCommand.cs Adjusts New-AzRoutingConfiguration parameter requirements and construction behavior.
src/Network/Network/ChangeLog.md Adds release notes entries for the new parameters/properties.
src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayConnectionTests.ps1 Adds scenario coverage for VNet gateway connection RoutingConfiguration.
src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayConnectionTests.cs Wires the new PowerShell scenario test into xUnit.
src/Network/Network.Test/ScenarioTests/RouteServerTests.ps1 Adds scenario coverage for route server peer RoutingConfiguration.
src/Network/Network.Test/ScenarioTests/RouteServerTests.cs Wires the new Route Server scenario test into xUnit.

Comment thread src/Network/Network.Test/ScenarioTests/RouteServerTests.ps1
Comment thread src/Network/Network.Test/ScenarioTests/RouteServerTests.ps1
Comment thread src/Network/Network/ChangeLog.md Outdated
@VeryEarly

Copy link
Copy Markdown
Collaborator

Hi @irramtir
please fix failed test cases

Copilot AI review requested due to automatic review settings July 28, 2026 03:41
@a0x1ab

a0x1ab commented Jul 28, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 21 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (4)

src/Network/Network/Cortex/VHubRouteTable/NewAzureRmRoutingConfigurationCommand.cs:81

  • If the user supplies -AssociatedRouteTable and it cannot be resolved, the cmdlet currently proceeds with a null AssociatedRouteTable, silently ignoring invalid input. This makes typos or bad IDs hard to detect and can lead to unexpected routing configuration objects.

Consider throwing when AssociatedRouteTable is non-empty but ResolveRouteTableId returns null (while still allowing AssociatedRouteTable to be omitted entirely).

            PSVHubRouteTable associatedRouteTable = null;
            if (!string.IsNullOrWhiteSpace(AssociatedRouteTable))
            {
                associatedRouteTable = ResolveRouteTableId(AssociatedRouteTable);
            }

src/Network/Network.Test/ScenarioTests/RouteServerTests.ps1:402

  • The assertions reference $peer.HubVnetConnectionReference, but the model exposed by this PR is HubVirtualNetworkConnection (see PSRouteServerPeer/PSBgpConnection). These assertions will fail because HubVnetConnectionReference is not a property on the returned object.
        Assert-AreEqual "65011" $peer.PeerAsn
        Assert-NotNull $peer.HubVnetConnectionReference
        Assert-AreEqual $peer.HubVnetConnectionReference.Id $hubVnetConnection.Id

src/Network/Network/help/New-AzVirtualNetworkGatewayConnection.md:47

  • Same issue in the SetByResourceId syntax block: -AcquirePolicyToken / -ChangeReference are not listed in SYNTAX, but the file still contains a -ChangeReference parameter section. Please keep SYNTAX consistent with the documented parameters.
 [-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>] [-AuthenticationType <String>]
 [-CertificateAuthentication <PSCertificateAuthentication>] [-AsJob] [-ExpressRouteGatewayBypass]
 [-EnablePrivateLinkFastPath] [-RoutingConfiguration <PSRoutingConfiguration>]
 [-DefaultProfile <IAzureContextContainer>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

src/Network/Network/help/Update-AzRouteServerPeer.md:28

  • Same inconsistency in the RouteServerNPeerNameParameterSet SYNTAX block: it lists the new parameters but omits -AcquirePolicyToken / -ChangeReference while the file still documents them (and another parameter set lists them).
Update-AzRouteServerPeer -ResourceGroupName <String> -PeerName <String> -PeerIp <String> -PeerAsn <UInt32>
 -RouteServerName <String> [-Force] [-AsJob] [-RoutingConfiguration <PSRoutingConfiguration>]
 [-VirtualHubVnetConnection <PSHubVirtualNetworkConnection>] [-VirtualHubVnetConnectionId <String>]
 [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]

Comment thread src/Network/Network.Test/ScenarioTests/RouteServerTests.ps1
Comment thread src/Network/Network/help/New-AzVirtualNetworkGatewayConnection.md
Comment thread src/Network/Network/help/Add-AzRouteServerPeer.md
Comment thread src/Network/Network/help/Update-AzRouteServerPeer.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants