Skip to content

[Az.Migrate] To Azure Local - additional validations #28183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

minhsuanlee
Copy link
Contributor

@minhsuanlee minhsuanlee commented Jul 15, 2025

Description

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

Copy link

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

@minhsuanlee minhsuanlee added this to the Az 14.3.0 (08/05/2025) milestone Jul 15, 2025
Copy link

@mayada83 mayada83 left a comment

Choose a reason for hiding this comment

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

approving with suggestion, we should try to accommodate other guest os type to provided as param from user if he knows the flavor is linux, if tools are not installed we should throw warning not failure, as its not blocker for migration business.

@minhsuanlee minhsuanlee requested a review from mayada83 July 18, 2025 22:59
@minhsuanlee minhsuanlee marked this pull request as ready for review July 21, 2025 23:31
@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 23:31
Copy link

‼️ 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.

Copy link
Contributor

@Copilot 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

This PR adds additional validations and parameter enhancements for the Azure Migrate "To Azure Local" functionality. The changes focus on improving error handling, validation logic, and adding OS type specification capabilities.

Key changes include:

  • Added -OsType parameter to Set-AzMigrateLocalServerReplication for user-specified OS type
  • Enhanced Arc Resource Bridge validation with clearer error messages
  • Improved RunAsAccount retrieval logic for both Hyper-V and VMware scenarios
  • Updated validation messages to be more informative and actionable

Reviewed Changes

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

Show a summary per file
File Description
Set-AzMigrateLocalServerReplication.ps1 Added OsType parameter with validation and integration into update logic
Start-AzMigrateLocalServerMigration.ps1 Enhanced Arc Resource Bridge validation and refactored parameter handling
New-AzMigrateLocalServerReplication.ps1 Improved RunAsAccount retrieval and replaced cluster validation with Arc Resource Bridge checks
CommonHelper.ps1 Updated validation logic and renamed function for better clarity
AzLocalCommonSettings.ps1 Enhanced error messages and added Arc Resource Bridge validation messages
*.md files Updated documentation to reflect new OsType parameter
README.md Modified directive configuration for HyperV operations
Start-AzMigrateLocalServerMigration.Tests.ps1 Added LiveOnly tag to test
Comments suppressed due to low confidence (1)

src/Migrate/Migrate.Autorest/custom/Helper/CommonHelper.ps1:40

  • The function name 'GetARGQueryForArcResourceBridge' uses inconsistent casing. PowerShell convention uses PascalCase with hyphens, so it should be 'Get-ARGQueryForArcResourceBridge' or follow the established pattern in the codebase.
function GetARGQueryForArcResourceBridge {

@YanaXu
Copy link
Contributor

YanaXu commented Jul 22, 2025

/azp run azure-powershell - security-tools

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@mayada83 mayada83 left a comment

Choose a reason for hiding this comment

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

looks good.

@minhsuanlee minhsuanlee force-pushed the user/samlee3/additional-validations branch from 6b54909 to be29aca Compare July 22, 2025 20:44
@minhsuanlee
Copy link
Contributor Author

/azp run azure-powershell - security-tools

Copy link
Contributor

Commenter does not have sufficient privileges for PR 28183 in repo Azure/azure-powershell

@minhsuanlee
Copy link
Contributor Author

minhsuanlee commented Jul 23, 2025

@YanaXu After building the module locally I see that Migrate.sln was automatically updated with some new GUID for Az.Migrate entry. Should I push that change too?

image

@YanaXu
Copy link
Contributor

YanaXu commented Jul 23, 2025

/azp run azure-powershell - security-tools

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@YanaXu
Copy link
Contributor

YanaXu commented Jul 23, 2025

@YanaXu After building the module locally I see that Migrate.sln was automatically updated with some new GUID for Az.Migrate entry. Should I push that change too?

image

Yes, just submit it.

@YanaXu
Copy link
Contributor

YanaXu commented Jul 23, 2025

Hi @minhsuanlee, I see you add a label "Do not merge". I'll keep this PR unmerged till your remove this label.

@minhsuanlee
Copy link
Contributor Author

@YanaXu After building the module locally I see that Migrate.sln was automatically updated with some new GUID for Az.Migrate entry. Should I push that change too?
image

Yes, just submit it.

Ok. I have also pushed other auto-updated files. Please let me know if any of them should not be included.

@YanaXu
Copy link
Contributor

YanaXu commented Jul 24, 2025

/azp run azure-powershell - security-tools

Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@YanaXu
Copy link
Contributor

YanaXu commented Jul 24, 2025

Hi @minhsuanlee, I've approved this PR. Please feel free to merge it if there are no other changes.
Please notice the next code complete date is 07/29/2025.

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