Skip to content

[Migrate] Initialize Azure Migrate and Azure Local Migrate Command Module#32289

Closed
saifaldin14 wants to merge 112 commits intoAzure:devfrom
saifaldin14:user/saif/newVersion
Closed

[Migrate] Initialize Azure Migrate and Azure Local Migrate Command Module#32289
saifaldin14 wants to merge 112 commits intoAzure:devfrom
saifaldin14:user/saif/newVersion

Conversation

@saifaldin14
Copy link
Copy Markdown

@saifaldin14 saifaldin14 commented Oct 20, 2025

Related command
Not applicable, as this is a new command module for Azure Migrate and Azure Local Migrate

Description

This PR is the first set of commands for the Azure Migrate and Azure Local Migrate command module, an Az CLI integration of the Azure service. This product has been recently announced to be GA (General Availability) and one of the requirements is that it needs to be available through PowerShell, Azure CLI and Terraform. We already have a PowerShell integration and this is the command module for the Azure CLI integration.

The commands that are included in this PR are:
az migrate local get-discovered-server: Retrieves a list of VMs available to the user on a particular subscription ID.
az migrate local replication init: Initializes a replication infrastructure for VM replication. Assigns the necessary roles and sets up the required permissions to execute a VM replication operation.
az migrate local replication new: Actually, performs the VM replication operations. Validates all required information and calls Azure Site Recovery to execute the operation.

Testing Guide
Unit tests for all 3 commands are written to make sure that the necessary validations and checks are actually being performed.

Note: This PR will be completed with Squash Commit, to not include all intermediary commits

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @saifaldin14,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Oct 20, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Oct 20, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

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

This PR introduces the initial Azure Migrate command module for Azure CLI, enabling VM migration operations to Azure Local and Azure Stack HCI environments. The implementation provides three core commands for server discovery, replication initialization, and VM replication execution.

Key Changes

  • Added az migrate local get-discovered-server command to retrieve and filter discovered VMs
  • Added az migrate local replication init command to initialize replication infrastructure with role assignments and permissions
  • Added az migrate local replication new command to perform VM replication operations via Azure Site Recovery

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 23 comments.

Show a summary per file
File Description
src/azure-cli/azure/cli/command_modules/migrate/__init__.py Command loader implementation with custom command type registration
src/azure-cli/azure/cli/command_modules/migrate/commands.py Command definitions for migrate local and replication command groups
src/azure-cli/azure/cli/command_modules/migrate/_params.py Parameter definitions and validation for all three commands
src/azure-cli/azure/cli/command_modules/migrate/_helpers.py Helper functions for API requests, resource management, and validation
src/azure-cli/azure/cli/command_modules/migrate/_help.py Comprehensive help documentation with examples for all commands
src/azure-cli/azure/cli/command_modules/migrate/tests/latest/test_migrate_commands.py Unit tests covering command validation and functionality
src/azure-cli/azure/cli/command_modules/migrate/tests/run_tests.py Test runner configuration
src/azure-cli/azure/cli/command_modules/migrate/README.md Module documentation with workflows and troubleshooting
src/azure-cli-core/azure/cli/core/profiles/_shared.py Added MGMT_MIGRATE resource type registration
doc/sphinx/azhelpgen/doc_source_map.json Added migrate help source mapping
.github/CODEOWNERS Added code ownership entry

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Oct 20, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@necusjz
Copy link
Copy Markdown
Member

necusjz commented Oct 22, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

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