[Migrate] Initialize Azure Migrate and Azure Local Migrate Command Module#32289
[Migrate] Initialize Azure Migrate and Azure Local Migrate Command Module#32289saifaldin14 wants to merge 112 commits intoAzure:devfrom
Conversation
|
Hi @saifaldin14, |
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
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-servercommand to retrieve and filter discovered VMs - Added
az migrate local replication initcommand to initialize replication infrastructure with role assignments and permissions - Added
az migrate local replication newcommand 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.
src/azure-cli/azure/cli/command_modules/migrate/tests/latest/test_migrate_commands.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…est_migrate_commands.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…/azure-cli into user/saif/newVersion
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
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