[PS] Migrate DnsResolver module to autorest v4#28695
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
|
To the author of the pull request, |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This pull request migrates the DnsResolver module from AutoRest v3 to AutoRest v4, introducing new features available in the updated code generator. The changes primarily involve regenerated help documentation, breaking change exception tracking, and minor namespace updates.
Changes:
- Upgraded help documentation with new parameter sets and corrected SYNOPSIS descriptions across all cmdlets
- Added breaking change exceptions CSV file to track API compatibility issues introduced by the migration
- Updated module manifest dependencies and metadata
- Modified namespace references from
Api20230701Previewto simplified model namespaces
Reviewed changes
Copilot reviewed 188 out of 188 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/DnsResolver/DnsResolver/ChangeLog.md | Added entry documenting AutoRest v4 upgrade |
| src/DnsResolver/DnsResolver/Az.DnsResolver.psd1 | Updated Az.Accounts dependency, generation date, and formatting |
| tools/StaticAnalysis/Exceptions/Az.DnsResolver/BreakingChangeIssues.csv | New file tracking 82 breaking changes from AutoRest migration |
| src/DnsResolver/DnsResolver/help/*.md | Updated SYNOPSIS from "Creates/Updates" to "Create/Update" and added new parameter sets |
| src/DnsResolver/DnsResolver.Autorest/docs/*.md | Similar help updates with parameter set additions |
| src/DnsResolver/DnsResolver.sln | Updated project GUID |
| src/DnsResolver/DnsResolver.Autorest/generate-info.json | Updated generation ID |
| src/DnsResolver/DnsResolver.Autorest/custom/csharp/*.cs | Updated namespace from Api20230701Preview to simplified Models |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Thanks @JoyerJin, I am on the private resolver team and will re-record the tests for the PR |
|
As mentioned in email, I have added the re-recorded tests in #29285 The PR above must also be released in the same version as this as we were previously using a preview branch and main is missing these changes |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Please also wait on breaking change annoucement merge: #29308 |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| * Upgraded API version from 2023-07-01-preview to 2025-10-01-preview | ||
| * Added new cmdlet `Invoke-AzDnsResolverBulkDnsResolverDomainList` | ||
| * Introduced various new features by upgrading code generator. Please see details [here](https://github.com/Azure/azure-powershell/blob/main/documentation/Autorest-powershell-v4-new-features.md). | ||
| * [Breaking Change] Removed parameter `ActionBlockResponseCode` from `New-AzDnsResolverPolicyDnsSecurityRule` and `Update-AzDnsResolverPolicyDnsSecurityRule`. The block response code is no longer configurable. | ||
| * [Breaking Change] Parameter `DnsResolverDomainList` is no longer mandatory on `New-AzDnsResolverPolicyDnsSecurityRule`. DNS security rules now support `ManagedDomainList` as an alternative. | ||
| * [Breaking Change] Parameter `Domain` is no longer mandatory on `New-AzDnsResolverDomainList`. Domain lists now support bulk upload via `Invoke-AzDnsResolverBulkDnsResolverDomainList`. |
There was a problem hiding this comment.
Changelog entries under "## Upcoming Release" should reference the related GitHub issue/PR numbers (for traceability) and be phrased for Azure PowerShell users. Consider adding references such as [#28698] / [#29308] to the migration + breaking-change bullets, and rewording the generator-upgrade line to describe the user-visible impact rather than the implementation detail.
| ### -VirtualNetworkName | ||
| The name of the virtual network. | ||
| The name of the VirtualNetwork |
There was a problem hiding this comment.
The parameter description uses inconsistent casing/wording: "The name of the VirtualNetwork" reads like a type name. Please change this to a user-facing phrase such as "The name of the virtual network."
| ### -VirtualNetworkName | ||
| The name of the virtual network. | ||
| The name of the VirtualNetwork | ||
|
|
There was a problem hiding this comment.
The parameter description uses inconsistent casing/wording: "The name of the VirtualNetwork" reads like a type name. Please change this to a user-facing phrase such as "The name of the virtual network."
| ### -VirtualNetworkName | ||
| The name of the virtual network. | ||
| The name of the VirtualNetwork | ||
|
|
There was a problem hiding this comment.
The parameter description uses inconsistent casing/wording: "The name of the VirtualNetwork" reads like a type name. Please change this to a user-facing phrase such as "The name of the virtual network."
| ### -Domain | ||
| The domains in the domain list. | ||
| Will be null if user is using large domain list. | ||
|
|
There was a problem hiding this comment.
"Will be null if user is using large domain list." is unclear/grammatically incorrect for help content. Consider rephrasing to explain when users should omit -Domain (for example, when using the bulk upload cmdlet) rather than describing the property value as null.
| It 'Delete a domain list' { | ||
| Remove-AzDnsResolverDomainList -Name "domainlist-rm-1" -ResourceGroupName $rgName | ||
| { Get-AzDnsResolverDomainList -Name "domainlist-rm-1" -ResourceGroupName $rgName } | Should -Throw |
There was a problem hiding this comment.
Remove-AzDnsResolverDomainList is called without disabling confirmation. Because this is a destructive cmdlet, it may prompt in non-interactive test runs and hang the suite. Please pass -Confirm:$false (or -Force if supported) in tests.
| AfterAll { | ||
| if ($TestMode -ne 'playback') { Remove-AzResourceGroup -Name $rgName -ErrorAction SilentlyContinue -AsJob | Out-Null } | ||
| } |
There was a problem hiding this comment.
Remove-AzResourceGroup is invoked without -Force/-Confirm:$false. In non-interactive test runs this can block on confirmation prompts and cause the test job to hang. Please add -Force (or explicitly disable confirmation) and consider waiting for the async job to complete (or avoid -AsJob) so resource cleanup is deterministic.
| It 'Delete a security rule' { | ||
| Remove-AzDnsResolverPolicyDnsSecurityRule -Name "secrule-rm-1" -DnsResolverPolicyName "policy-secrule-r" -ResourceGroupName $rgName | ||
| { Get-AzDnsResolverPolicyDnsSecurityRule -Name "secrule-rm-1" -DnsResolverPolicyName "policy-secrule-r" -ResourceGroupName $rgName } | Should -Throw |
There was a problem hiding this comment.
Remove-AzDnsResolverPolicyDnsSecurityRule is called without disabling confirmation. Because this is a destructive cmdlet, it may prompt in non-interactive test runs and hang the suite. Please pass -Confirm:$false (or -Force if supported) in tests.
| AfterAll { | ||
| if ($TestMode -ne 'playback') { | ||
| Remove-AzResourceGroup -Name $rgName -ErrorAction SilentlyContinue -AsJob | Out-Null | ||
| } |
There was a problem hiding this comment.
Remove-AzResourceGroup is invoked without -Force/-Confirm:$false. In non-interactive test runs this can block on confirmation prompts and cause the test job to hang. Please add -Force (or explicitly disable confirmation) and consider waiting for the async job to complete (or avoid -AsJob) so resource cleanup is deterministic.
| New-AzDnsResolver -Name "resolver-rm-1" -ResourceGroupName $rgName -VirtualNetworkId $vnetId -Location $location | ||
| Remove-AzDnsResolver -Name "resolver-rm-1" -ResourceGroupName $rgName | ||
|
|
There was a problem hiding this comment.
Remove-AzDnsResolver is called without disabling confirmation. Because this is a destructive cmdlet, it may prompt in non-interactive test runs and hang the suite. Please pass -Confirm:$false (or -Force if supported) in tests.
|
/azp run |
|
Commenter does not have sufficient privileges for PR 28695 in repo Azure/azure-powershell |
|
I can't seem to approve this PR but I have ran the tests again myself using the built module and everything is working as expected, signing off from Managed Resolver team |
Description
Preannouncement PR:
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.