Add PowerShell cmdlets for Microsoft.Network/interconnectGroups - #30004
Conversation
491214a to
d898bf2
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Adds SDK-based Az.Network support for interconnect groups and their read-only subgroups, using Network SDK operations introduced by #29992.
Changes:
- Adds six cmdlets and five PowerShell models.
- Adds mappings, exports, changelog entries, and reference help.
- Adds nine recorded scenario tests covering CRUD and availability workflows.
Reviewed changes
Copilot reviewed 24 out of 33 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
Models/PSSubgroupProfile.cs |
Defines subgroup configuration. |
Models/PSSubgroupNodeAvailabilityEntry.cs |
Defines subgroup availability data. |
Models/PSSubgroup.cs |
Defines subgroup output. |
Models/PSInterconnectGroupNodeAvailability.cs |
Defines availability output. |
Models/PSInterconnectGroup.cs |
Defines interconnect-group output. |
InterconnectGroup/SetAzureRmInterconnectGroupCommand.cs |
Implements updates. |
InterconnectGroup/RemoveAzureRmInterconnectGroupCommand.cs |
Implements deletion. |
InterconnectGroup/NewAzureRmInterconnectGroupCommand.cs |
Implements creation. |
InterconnectGroup/InterconnectGroupBaseCmdlet.cs |
Provides shared SDK access. |
InterconnectGroup/GetAzureRmInterconnectGroupSubgroupCommand.cs |
Implements subgroup retrieval. |
InterconnectGroup/GetAzureRmInterconnectGroupNodeAvailabilityCommand.cs |
Implements availability retrieval. |
InterconnectGroup/GetAzureRmInterconnectGroupCommand.cs |
Implements get/list operations. |
help/Set-AzInterconnectGroup.md |
Documents update usage. |
help/Remove-AzInterconnectGroup.md |
Documents deletion usage. |
help/New-AzInterconnectGroup.md |
Documents creation usage. |
help/Get-AzInterconnectGroupSubgroup.md |
Documents subgroup retrieval. |
help/Get-AzInterconnectGroupNodeAvailability.md |
Documents availability retrieval. |
help/Get-AzInterconnectGroup.md |
Documents get/list usage. |
help/Az.Network.md |
Adds module help links. |
Common/NetworkResourceManagerProfile.cs |
Registers model mappings. |
ChangeLog.md |
Announces the cmdlets. |
Az.Network.psd1 |
Exports the cmdlets. |
ScenarioTests/InterconnectGroupTests.ps1 |
Defines scenario workflows. |
ScenarioTests/InterconnectGroupTests.cs |
Registers nine xUnit tests. |
SessionRecords/.../TestInterconnectGroupCRUD.json |
Records CRUD traffic. |
SessionRecords/.../TestInterconnectGroupCRUDWithTags.json |
Records tagged CRUD traffic. |
SessionRecords/.../TestInterconnectGroupCRUDWithSubgroupProfile.json |
Records profile traffic. |
SessionRecords/.../TestInterconnectGroupGetByResourceId.json |
Records resource-ID retrieval. |
SessionRecords/.../TestInterconnectGroupList.json |
Records listing traffic. |
SessionRecords/.../TestInterconnectGroupSet.json |
Records update traffic. |
SessionRecords/.../TestInterconnectGroupRemoveByPipeline.json |
Records pipeline deletion. |
SessionRecords/.../TestInterconnectGroupSubgroupGet.json |
Records subgroup traffic. |
SessionRecords/.../TestInterconnectGroupNodeAvailability.json |
Records availability traffic. |
Suppressed comments (1)
src/Network/Network.Test/ScenarioTests/InterconnectGroupTests.ps1:317
- The recorded list response is empty, so this conditional is skipped and the new subgroup get-by-name and get-by-resource-ID paths pass playback without ever being exercised. The scenario should arrange at least one subgroup (or provide a focused mocked test) and assert both paths unconditionally.
if ($subgroups.Count -gt 0)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| $filtered = Get-AzInterconnectGroup -ResourceGroupName $rgName -Name $interconnectGroupName1 | ||
| Assert-AreEqual 1 @($filtered).Count | ||
| Assert-AreEqual $interconnectGroupName1 $filtered[0].Name |
There was a problem hiding this comment.
Fixed. Get-AzInterconnectGroup -ResourceGroupName <rg> -Name <literal> satisfies ShouldGetByName, so the cmdlet took the direct Get path and TopLevelWildcardFilter never ran. The recorded traffic confirmed it: a single-resource GET .../interconnectGroups/ps4711, not a list.
Test-InterconnectGroupList now follows the NetworkInterfaceTests.ps1 precedent (lines 951-966) plus a narrowing assertion:
$list = Get-AzInterconnectGroup -ResourceGroupName "*" -Name "*"
Assert-True { $list.Count -ge 0 }
$list = Get-AzInterconnectGroup -Name "*"
Assert-True { $list.Count -ge 0 }
$list = Get-AzInterconnectGroup -ResourceGroupName "*"
Assert-True { $list.Count -ge 0 }
# Wildcard pattern matching only the first group exercises TopLevelWildcardFilter
$wildcardFiltered = Get-AzInterconnectGroup -ResourceGroupName $rgName -Name "$interconnectGroupName1*"
Assert-AreEqual 1 @($wildcardFiltered).Count
Assert-AreEqual $interconnectGroupName1 $wildcardFiltered[0].NameThe last block is the important one: Get-ResourceName emits a fixed-length ps + 4 digits, so ps4711* cannot also match the second group. That proves the filter actually narrows the list rather than just running.
The same treatment was applied to Get-AzInterconnectGroupSubgroup for the other comment, following the Get-AzVirtualNetworkPeering -Name "*" precedent in VirtualNetworkTests.ps1:964:
# Wildcard name exercises SubResourceWildcardFilter regardless of subgroup count
$wildcardSubgroups = @(Get-AzInterconnectGroupSubgroup -ResourceGroupName $rgName -InterconnectGroupName $interconnectGroupName -Name "*")
Assert-AreEqual $subgroups.Count $wildcardSubgroups.CountThis runs unconditionally, so SubResourceWildcardFilter is now covered even when the group has no subgroups. The exact-name and -ResourceId direct-Get paths still cannot be exercised: subgroups are service-allocated read-only children created when VMs land in the group, so a freshly created group legitimately has none, and materialising one would require deploying Standard_ND128isr_GB300_v6 VMs from a scenario test.
TestInterconnectGroupList and TestInterconnectGroupSubgroupGet were re-recorded against 2025-09-01; the full class passes playback 9/9.
|
jbouzarouata1 |
|
The new PSInterconnectGroup and PSSubgroup output types declare table formatting through Ps1Xml, but Network.generated.format.ps1xml has no corresponding views. This file is loaded as a committed artifact and is not generated during build or at runtime. Could you regenerate and commit it so these cmdlets use their intended table output? |
d898bf2 to
744f142
Compare
Adds full PowerShell support for the interconnectGroups resource and its read-only subgroups child resource: - Get-AzInterconnectGroup - New-AzInterconnectGroup - Set-AzInterconnectGroup - Remove-AzInterconnectGroup - Get-AzInterconnectGroupSubgroup - Get-AzInterconnectGroupNodeAvailability Includes PS output models, AutoMapper mappings, module exports, help documentation, scenario tests, and session recordings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3c9d8850-606a-4274-9d52-ef56118d58d0
744f142 to
bf96ca1
Compare
Good catch — fixed in What was wrong: the Fix: ran Resulting tables:
While regenerating I also noticed Verified: XML well-formed, view count 230 -> 232, CRLF preserved, Conflicts are also resolved — the PR now reports |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
8d12186
into
Azure:release-network-2025-09-01
🤖 PR Validation —⚠️ Review suggested
️✔️Az.Accounts
️✔️Az.ApplicationInsights
️✔️Az.CognitiveServices
️✔️Az.Compute
️✔️Az.Dns
️✔️Az.Maintenance
️✔️Az.ManagedServiceIdentity
️✔️Az.Monitor
️✔️Az.OperationalInsights
️✔️Az.PrivateDns
️✔️Az.RecoveryServices
️✔️Az.Resources
️✔️Az.Security
️✔️Az.ServiceBus
️✔️Az.Sql
️✔️Az.Storage
️✔️Az.Websites
Description
Adds full PowerShell support for the
Microsoft.Network/interconnectGroupsresource and its read-onlysubgroupschild resource.New cmdlets
Get-AzInterconnectGroupNew-AzInterconnectGroupSet-AzInterconnectGroupRemove-AzInterconnectGroupGet-AzInterconnectGroupSubgroupGet-AzInterconnectGroupNodeAvailabilityExample
Changes
PSInterconnectGroup,PSSubgroup,PSSubgroupProfile,PSInterconnectGroupNodeAvailability,PSSubgroupNodeAvailabilityEntrysrc/Network/Network/InterconnectGroup/NetworkResourceManagerProfile.csAz.Network.psd1andChangeLog.mdAz.Network.mdmodule page entriesNo SDK changes:
InterconnectGroupsOperations/SubgroupsOperationsalready exist inNetwork.Management.Sdkat api-version2025-09-01(added by #29992).Checklist
release-network-2025-09-01as the target branchChangeLog.md