[Automated Tracing] Enable support for vnet peering and multiple interfaces - #603
Merged
Adam Rudell (arudell) merged 5 commits intoJul 28, 2026
Merged
Conversation
adfema
approved these changes
Jul 15, 2026
Adam Rudell (arudell)
enabled auto-merge (squash)
July 28, 2026 22:02
Adam Rudell (arudell)
deleted the
enable-support-for-vnet-peering-tracing
branch
July 28, 2026 22:03
Contributor
There was a problem hiding this comment.
Pull request overview
Adds multi-interface tracing and gateway discovery across peered virtual networks.
Changes:
- Accepts network-interface arrays and documents pipeline usage.
- Resolves local and remote virtual gateways.
- Removes unused provider-network variables.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/modules/SdnDiag.Common.psm1 |
Expands interface tracing and gateway mapping. |
src/modules/SdnDiag.Health.psm1 |
Removes unused variables. |
|
|
||
| [CmdletBinding(DefaultParameterSetName = 'RestCredential')] | ||
| param ( | ||
| [Parameter(Mandatory = $true, ValueFromPipeline = $true)] |
| foreach ($vgw in $virtualGateways) { | ||
| # gatewaySubnets.resourceRef can include additional path segments, | ||
| # so escape and use regex match against the network resource reference | ||
| if ($vgw.properties.gatewaySubnets.resourceRef -match [regex]::Escape($gatewayNetworkResourceRef)) { |
| $virtualGateways = Get-SdnResource @ncRestParams -Resource 'virtualGateways' | ||
| $virtualNetworks = Get-SdnResource @ncRestParams -Resource 'virtualNetworks' | ||
|
|
||
| foreach ($interface in $NetworkInterface) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request updates the
Enable-SdnNetworkInterfaceTracefunction to support enabling network tracing for multiple network interfaces at once, and improves the logic for mapping virtual gateways, including peered virtual networks. It also enhances the documentation and parameter validation to reflect these new capabilities.Enhancements to multi-interface support:
NetworkInterfaceparameter to accept an array of objects, allowing tracing to be enabled for one or more interfaces simultaneously. The parameter validation logic now checks each provided object for the correct resource type. (F7a09d14L2358R2376)Improvements to virtual gateway mapping:
useRemoteGatewaysis set. The function now builds a list of all relevant gateways, rather than stopping at the first match.Documentation and usability:
No significant changes were made to
Test-SdnProviderNetworkin this pull request.Change type
Checklist: