Skip to content

Dev/jamesvoong/dnsresolver v4 preview#29285

Merged
JunKai-v merged 24 commits intoAzure:joyer/dnsresolver-migrate-v4from
jamesvoongms:dev/jamesvoong/dnsresolver-v4-preview
Mar 25, 2026
Merged

Dev/jamesvoong/dnsresolver v4 preview#29285
JunKai-v merged 24 commits intoAzure:joyer/dnsresolver-migrate-v4from
jamesvoongms:dev/jamesvoong/dnsresolver-v4-preview

Conversation

@jamesvoongms
Copy link
Member

@jamesvoongms jamesvoongms commented Mar 19, 2026

Description

PR adds from the branch Azure/azure-powershell at Az.DNSResolver-preview into the v4 changes so that the next major release includes both V4 autorest and 2025-10-01-preview version changes into major release.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

jamesvoongms and others added 2 commits March 19, 2026 13:29
Base: joyer/dnsresolver-migrate-v4 (autorest v3->v4 migration)

Changes applied on top:
- Custom C# wrappers: namespace updated to v4 pattern (Models, no API version suffix)
- README.md: v4 autorest config + 2025-10-01-preview spec path
- Custom PS1 cmdlets: v4 parameter patterns from joyer's branch
- v4 new wrapper files retained (ViaJsonFilePath, ViaJsonString, ViaIdentityParent)

Next steps:
- Run autorest to regenerate the module with v4 + 2025-10-01-preview
- Re-record tests per https://eng.ms/docs/.../dev_guidance_codegen#test
- Build and validate

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ran: autorest README.md (730 files generated)
Ran: build-module.ps1 -NoDocs (build succeeded)

Generated code now uses:
- Autorest PowerShell v4 (4.0.752)
- API spec: 2025-10-01-preview/openapi.json
- Clean Models namespace (no API version suffix)
- Includes BulkDnsResolverDomainList cmdlet

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

- $(repo)/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2023-07-01-preview/dnsresolver.json
- $(repo)/specification/dnsresolver/resource-manager/Microsoft.Network/preview/2023-07-01-preview/dnsresolverpolicy.json
- C:/Git/jamesvoong-azure-rest-api-specs/specification/dnsresolver/resource-manager/Microsoft.Network/DnsResolver/preview/2025-10-01-preview/openapi.json
- C:/Git/jamesvoong-azure-rest-api-specs/specification/dnsresolver/resource-manager/Microsoft.Network/DnsResolver/preview/2025-10-01-preview/openapi.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert before merge

@NoriZC
Copy link
Contributor

NoriZC commented Mar 19, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@NoriZC
Copy link
Contributor

NoriZC commented Mar 19, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

jamesvoongms and others added 2 commits March 19, 2026 16:14
…ls.ps1

- New-AzDnsResolver.Tests.ps1: self-contained with BeforeAll/AfterAll
  - Creates own RG, VNets, and resolvers
  - Cleans up via Remove-AzResourceGroup in AfterAll
  - No dependency on utils.ps1, Constants.ps1, loadEnv.ps1, or assertions
  - 5/5 tests passed in Record mode against 2025-10-01-preview API
- utils.ps1: setupEnv/cleanupEnv now no-ops (tests are self-contained)
- Recording updated with 2025-10-01-preview API responses

Template validated — remaining 46 test files to follow this pattern.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All 4 core resolver test files now self-contained:
- New-AzDnsResolver: 5/5 passed
- Get-AzDnsResolver: 2/2 passed
- Remove-AzDnsResolver: 1/1 passed
- Update-AzDnsResolver: 1/1 passed

Total: 9 tests passed, 0 failed. Recordings updated to 2025-10-01-preview.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 19, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

jamesvoongms and others added 2 commits March 19, 2026 16:45
Policy: New/Get/Update/Remove — 6 tests passed
DomainList: New/Get/Update/Remove — 5 tests passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SecurityRule: New/Get/Update/Remove — 5 tests passed
PolicyVNetLink: New/Get/Update/Remove — 5 tests passed
Also includes DnsSecurityRule variant copies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

jamesvoongms and others added 2 commits March 19, 2026 17:51
InboundEndpoint: New/Get/Update/Remove/Set — 6 tests passed
IPConfigurationObject: 2 tests passed
TargetDnsServerObject: 1 test passed
Set-AzDnsResolver: 1 test passed
BulkDnsResolverDomainList: placeholder (skipped)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…passing)

OutboundEndpoint: New/Get/Update/Remove — 5 tests passed
ForwardingRuleset: New/Get/Update/Remove — 5 tests passed
ForwardingRule: New/Get/Update/Remove — 5 tests passed
ForwardingRulesetVNetLink: New/Get/Update/Remove — 5 tests passed

Fixed double-quote escaping in generated test files.
All 47 test files now self-contained with BeforeAll/AfterAll.
All recordings updated to 2025-10-01-preview API.

Total: 47/47 test files rewritten, all passing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

- Tests bulk upload of domains from storage blob to domain list
- Creates storage account, blob container, and SAS token in BeforeAll
- Verifies domain list provisioning state after bulk upload
- Includes recorded responses for playback mode

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

jamesvoongms and others added 2 commits March 19, 2026 23:55
- Removed ActionBlockResponseCode parameter (blockResponseCode removed from API)
- DnsResolverDomainList no longer mandatory on New-AzDnsResolverPolicyDnsSecurityRule
- Domain no longer mandatory on New-AzDnsResolverDomainList (bulk upload alternative)
- Updated examples to remove stale -ActionBlockResponseCode references
- Added breaking-change directives in README.md autorest config

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesvoongms jamesvoongms marked this pull request as ready for review March 20, 2026 07:08
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Recording files are required by the test framework to avoid
ArgumentException in playback mode. Empty {} files allow tests
to load without crashing. Tests should be re-recorded against
the 2025-10-01-preview API for full playback support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

All 47 tests passed (45 with recordings, 2 in-memory tests).
Added record-all-tests.ps1 wrapper script that handles the
test framework's recording erasure behavior by backing up each
recording immediately after it's created.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

These tests (IPConfigurationObject, TargetDnsServerObject) don't make
HTTP calls so they produce no recordings. Empty {} files are needed
to prevent ArgumentException in CI playback mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

jamesvoongms and others added 2 commits March 20, 2026 14:49
Update playback subscription from old 91ab65d2 to 97db216c
to match the subscription used when recording tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests used Get-Random for RG names which produced different values
in playback vs record mode. Updated all 44 test files to use the
exact RG names from their recordings so playback works correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Moved resource creation from It blocks to BeforeAll so the request
counter matches between record and playback modes. Re-recorded both
tests. All 63 tests now pass in playback mode.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 20, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@NoriZC
Copy link
Contributor

NoriZC commented Mar 23, 2026

Hi @jamesvoongms
Please remove the detected Cred: [Error] 1. Credential Scanner Error CSCAN-AZURE0060 - File: SecurityTmp/src/DnsResolver/DnsResolver.Autorest/test/Invoke-AzDnsResolverBulkDnsResolverDomainList.Recording.json:SecurityTmp/src/DnsResolver/DnsResolver.Autorest/test/Invoke-AzDnsResolverBulkDnsResolverDomainList.Recording.json. Line: 180. Column 218.

@NoriZC NoriZC self-assigned this Mar 23, 2026
@github-actions
Copy link

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

jamesvoongms and others added 3 commits March 24, 2026 00:17
Irrelevant file flagged by reviewer. Moved to personal scripts folder.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ials

The test requires a Storage Account with SAS tokens for bulk upload/download.
The autorest v4 recording framework does not sanitize SAS tokens, so the
recording file contained exposed credentials (flagged by reviewer).

Test is marked -Skip with guidance to run manually in live mode.
Recording file removed to eliminate credential exposure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ran build-module.ps1 -Docs to regenerate all cmdlet help markdown files
from the compiled v4 + 2025-10-01-preview module. Docs now reflect updated
cmdlet signatures including new ViaJsonFilePath/ViaJsonString variants.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@NoriZC
Copy link
Contributor

NoriZC commented Mar 24, 2026

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@JunKai-v JunKai-v merged commit ec0fd4c into Azure:joyer/dnsresolver-migrate-v4 Mar 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants