Add RoutingConfiguration support for RouteServerPeer and VirtualNetworkGateway Connections - #29910
Add RoutingConfiguration support for RouteServerPeer and VirtualNetworkGateway Connections#29910irramtir wants to merge 8 commits into
Conversation
…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
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
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
-RoutingConfigurationsupport toNew-AzVirtualNetworkGatewayConnectionandSet-AzVirtualNetworkGatewayConnection. - Added
-RoutingConfigurationplus hub vnet connection association parameters toAdd-AzRouteServerPeerandUpdate-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. |
|
Hi @irramtir |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
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>]
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
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.