[Az.Migrate] Add validation for HA, storagepath, storageaccount, and bug fix#29414
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
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-AzMigrateLocalReplicationInfrastructureto 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. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
|
1 similar comment
|
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@VeryEarly please assist us in merging this PR. Thank you. |


Description
Add validation for HA, storagepath, storageaccount, and bug fix for caller identity resolution for Service Principal and Managed Identity
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.