[Network] Add address prefix set cmdlets - #29985
Conversation
Regenerate the Network SDK from the 2025-09-01 Swagger and add PowerShell CRUD cmdlets, help, exports, changelog, and tests for application security group address prefix sets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
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). |
|
rajanalavarnitha-wq Please fix the CI failures. |
Regenerate the SDK whitespace exactly as AutoRest emits it and expose the new Application Gateway global configuration property in the PowerShell model. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
/azp run |
|
Fixed the CI failures in commit 31e5dad. The generated SDK now exactly matches AutoRest output, and the PowerShell Application Gateway global configuration model includes the new DisableDefaultServerHeaderInResponse property that caused the 18 cross-platform test failures. The affected Application Gateway and Address Prefix Set tests pass locally. |
|
Commenter does not have sufficient privileges for PR 29985 in repo Azure/azure-powershell |
|
ZelinWang (@wangzelin007) Aditya Pujara (@a0x1ab) Could you please rerun Azure Pipelines? The fix is pushed, but my /azp run request was rejected because the PR author does not have pipeline permissions. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
Added mocked execution tests for all four new Address Prefix Set cmdlets in commit 01384a4:\n\n- Get-AzAddressPrefixSet\n- New-AzAddressPrefixSet\n- Set-AzAddressPrefixSet\n- Remove-AzAddressPrefixSet\n\nThe focused Network test run passes: 5 passed, 0 failed (the four cmdlet tests plus the existing model validation test). Please rerun the Azure Pipelines checks when available, since the PR author cannot authorize them. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
Synced this PR with the latest release-network-2025-09-01 branch and removed the duplicated generated Network SDK changes from the PR diff. The cmdlet implementation now consumes the SDK merged by #29992. The Network test project builds successfully and all 5 focused Address Prefix Set tests pass. The PR is now mergeable. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Adds new Az.Network cmdlets and supporting infrastructure to manage Address Prefix Sets under Application Security Groups (ASGs), including a new PowerShell model, cmdlet implementations, reference help, changelog/release notes updates, and targeted unit-style scenario tests.
Changes:
- Added
Get/New/Set/Remove-AzAddressPrefixSetcmdlets backed by new base cmdlet logic and PS model mapping. - Added reference help markdown for the new cmdlets and updated module exports + release notes.
- Added targeted tests and updated the Network test project references to include the Network cmdlet project.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Network/Network/Models/PSAddressPrefixSet.cs | Introduces PS model for Address Prefix Set and display helpers. |
| src/Network/Network/help/Get-AzAddressPrefixSet.md | Adds reference help for Get-AzAddressPrefixSet. |
| src/Network/Network/help/New-AzAddressPrefixSet.md | Adds reference help for New-AzAddressPrefixSet. |
| src/Network/Network/help/Set-AzAddressPrefixSet.md | Adds reference help for Set-AzAddressPrefixSet. |
| src/Network/Network/help/Remove-AzAddressPrefixSet.md | Adds reference help for Remove-AzAddressPrefixSet. |
| src/Network/Network/ChangeLog.md | Adds upcoming-release notes for the new cmdlets. |
| src/Network/Network/Az.Network.psd1 | Exports the new cmdlets and updates module ReleaseNotes. |
| src/Network/Network/ApplicationSecurityGroup/AddressPrefixSet/AddressPrefixSetBaseCmdlet.cs | Implements shared client access + CRUD helpers + SDK-to-PS mapping for address prefix sets. |
| src/Network/Network/ApplicationSecurityGroup/AddressPrefixSet/GetAzureRmAddressPrefixSetCommand.cs | Implements Get-AzAddressPrefixSet cmdlet. |
| src/Network/Network/ApplicationSecurityGroup/AddressPrefixSet/NewAzureRmAddressPrefixSetCommand.cs | Implements New-AzAddressPrefixSet cmdlet. |
| src/Network/Network/ApplicationSecurityGroup/AddressPrefixSet/SetAzureRmAddressPrefixSetCommand.cs | Implements Set-AzAddressPrefixSet cmdlet. |
| src/Network/Network/ApplicationSecurityGroup/AddressPrefixSet/RemoveAzureRmAddressPrefixSetCommand.cs | Implements Remove-AzAddressPrefixSet cmdlet. |
| src/Network/Network.Test/ScenarioTests/ApplicationSecurityGroupTests.cs | Adds SDK model validation coverage for address prefix set properties. |
| src/Network/Network.Test/ScenarioTests/AddressPrefixSetCmdletTests.cs | Adds targeted cmdlet tests for Get/New/Set/Remove address prefix sets. |
| src/Network/Network.Test/Network.Test.csproj | Adds reference to Network cmdlet project so cmdlet types can be exercised in tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| [Alias("ParentName", "ParentResourceName")] | ||
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The application security group name.")] | ||
| [ResourceNameCompleter("Microsoft.Network/applicationSecurityGroups", "ResourceGroupName")] | ||
| public string ApplicationSecurityGroupName { get; set; } |
There was a problem hiding this comment.
rajanalavarnitha-wq
Can you please take a look?
There was a problem hiding this comment.
Added ValidateNotNullOrEmpty to ApplicationSecurityGroupName in Get-AzAddressPrefixSet.
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The resource group name.")] | ||
| [ResourceGroupCompleter] | ||
| public string ResourceGroupName { get; set; } | ||
|
|
||
| [Alias("ParentName", "ParentResourceName")] | ||
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The application security group name.")] | ||
| public string ApplicationSecurityGroupName { get; set; } | ||
|
|
||
| [Alias("ResourceName", "AddressPrefixSetName")] | ||
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The address prefix set name.")] | ||
| public string Name { get; set; } |
There was a problem hiding this comment.
rajanalavarnitha-wq
Can you please take a look?
There was a problem hiding this comment.
Added ValidateNotNullOrEmpty to ResourceGroupName, ApplicationSecurityGroupName, and Name in Set-AzAddressPrefixSet.
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The resource group name.")] | ||
| [ResourceGroupCompleter] | ||
| public string ResourceGroupName { get; set; } | ||
|
|
||
| [Alias("ParentName", "ParentResourceName")] | ||
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The application security group name.")] | ||
| public string ApplicationSecurityGroupName { get; set; } | ||
|
|
||
| [Alias("ResourceName", "AddressPrefixSetName")] | ||
| [Parameter(Mandatory = true, ParameterSetName = ByApplicationSecurityGroupName, HelpMessage = "The address prefix set name.")] | ||
| public string Name { get; set; } |
There was a problem hiding this comment.
rajanalavarnitha-wq
Can you please take a look?
There was a problem hiding this comment.
Added ValidateNotNullOrEmpty to ResourceGroupName, ApplicationSecurityGroupName, and Name in Remove-AzAddressPrefixSet.
| * Added address prefix set management for application security groups | ||
| - Added `Get-AzAddressPrefixSet`, `New-AzAddressPrefixSet`, `Set-AzAddressPrefixSet`, and `Remove-AzAddressPrefixSet` | ||
| - Supports IPv4 and IPv6 prefixes in CIDR notation | ||
| - Related Swagger change: Azure/azure-rest-api-specs [#44737] |
There was a problem hiding this comment.
Updated the changelog to expand Classless Inter-Domain Routing (CIDR) and removed the internal Swagger reference.
| ReleaseNotes = '* Added address prefix set management for application security groups | ||
| - Added ''Get-AzAddressPrefixSet'', ''New-AzAddressPrefixSet'', ''Set-AzAddressPrefixSet'', and ''Remove-AzAddressPrefixSet'' | ||
| - Supports IPv4 and IPv6 prefixes in CIDR notation | ||
| - Related Swagger change: Azure/azure-rest-api-specs [#44737] |
There was a problem hiding this comment.
Updated the module release notes to expand Classless Inter-Domain Routing (CIDR) and removed the internal Swagger reference.
|
rajanalavarnitha-wq |
|
New-AzAddressPrefixSet reaches the service’s create-or-replace PUT without checking whether the child already exists. A same-name call can therefore replace the existing prefixes without -Force or an overwrite warning. Could you add the standard existence check and -Force confirmation used by New-AzIpAllocation and New-AzPublicIpPrefix? Set-AzAddressPrefixSet calls the create-or-replace PUT without first verifying that the target exists, so a typo can create a new prefix set even though the cmdlet is documented as updating an existing one. Could you fail with ResourceNotFound when the target is absent, as Set-AzIpAllocation and Set-AzPublicIpPrefix do? |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
Addressed both create/update safety comments in commit 277275a. New-AzAddressPrefixSet now checks whether the child exists and uses the standard -Force overwrite confirmation flow. Set-AzAddressPrefixSet now checks existence and throws ResourceNotFound before PUT when absent. Added regression coverage for forced overwrite existence checking and missing-resource update behavior; all 7 focused Address Prefix Set tests pass. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 378b9494-222c-402e-9d58-2c57776e54ec
Head branch was pushed to by a user without write access
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
33600f1
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 PowerShell support for address prefix set operations under Application Security Groups.
Validation