Skip to content

[Az.Migrate] Add validation for HA, storagepath, storageaccount, and bug fix#29414

Merged
VeryEarly merged 7 commits intoAzure:mainfrom
minhsuanlee:user/samlee3/validation-bug-fixes
Apr 28, 2026
Merged

[Az.Migrate] Add validation for HA, storagepath, storageaccount, and bug fix#29414
VeryEarly merged 7 commits intoAzure:mainfrom
minhsuanlee:user/samlee3/validation-bug-fixes

Conversation

@minhsuanlee
Copy link
Copy Markdown
Contributor

@minhsuanlee minhsuanlee commented Apr 16, 2026

Description

Add validation for HA, storagepath, storageaccount, and bug fix for caller identity resolution for Service Principal and Managed Identity

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

Copilot AI review requested due to automatic review settings April 16, 2026 19:04
@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds additional runtime validation and error handling for AzLocal migration/replication flows in Az.Migrate to prevent misconfiguration (HA state, storage path, and cache storage account settings) and improves caller identity resolution.

Changes:

  • Tightens replication pre-checks around Hyper-V HA status (including an explicit “Unknown” path).
  • Adds storage path existence/state validation during New-AzMigrateLocalServerReplication.
  • Updates Initialize-AzMigrateLocalReplicationInfrastructure to resolve caller identity across user/SP/managed identity and adds cache storage account validations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1 Makes ARM ID validation unconditional and adds storage path existence/provisioning checks before starting replication.
src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateLocalReplicationInfrastructure.ps1 Updates caller identity resolution logic and adds cache storage account validation (SKU and access settings).
src/Migrate/Migrate.Autorest/custom/Helper/AzLocalCommonSettings.ps1 Extends HA constants/messages to include an “Unknown” state and improved wording.
src/Migrate/Migrate.Autorest/custom/Helper/AzLocalCommonHelper.ps1 Enhances replication prerequisites to treat clustered Hyper-V VMs with unknown HA status as invalid.

Comment thread src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1 Outdated
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings April 16, 2026 21:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1 Outdated
Comment thread src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1 Outdated
@minhsuanlee minhsuanlee added this to the Az 15.6.0 (05/05/2026) milestone Apr 16, 2026
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@github-actions
Copy link
Copy Markdown

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

1 similar comment
@github-actions
Copy link
Copy Markdown

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

@minhsuanlee
Copy link
Copy Markdown
Contributor Author

minhsuanlee commented Apr 17, 2026

Validating changed scenarios:

  1. [passed] Storage account has "Public Network Access" Disabled - should result in failure
image 2. [passed] Storage path check in `New-AzMigrateLocalServerReplication` image

@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings April 17, 2026 21:04
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/Migrate/Migrate.Autorest/custom/New-AzMigrateLocalServerReplication.ps1 Outdated
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings April 17, 2026 21:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/Migrate/Migrate/ChangeLog.md
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@minhsuanlee
Copy link
Copy Markdown
Contributor Author

@VeryEarly please assist us in merging this PR. Thank you.

@VeryEarly VeryEarly self-assigned this Apr 28, 2026
@VeryEarly VeryEarly merged commit 70cfa97 into Azure:main Apr 28, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants