Skip to content

[Azure Migrate Local] Start migration command, preview channel versioning & new commands for replication #9493

Merged
wangzelin007 merged 13 commits intoAzure:mainfrom
mettursathish:main
Dec 31, 2025
Merged

[Azure Migrate Local] Start migration command, preview channel versioning & new commands for replication #9493
wangzelin007 merged 13 commits intoAzure:mainfrom
mettursathish:main

Conversation

@mettursathish
Copy link
Contributor


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

Added the new start migration command.
Resolved preview versioning issues.
Introduced list and get commands for replication.

  • az migrate local replication list
  • az migrate local replication get
  • az migrate local start-migration

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings December 26, 2025 19:18
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 26, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️migrate
rule cmd_name rule_message suggest_message
⚠️ 1003 - CmdPropAdd migrate get-discovered-server cmd migrate get-discovered-server added property is_preview
⚠️ 1001 - CmdAdd migrate local replication get cmd migrate local replication get added
⚠️ 1003 - CmdPropAdd migrate local replication get-job cmd migrate local replication get-job added property is_preview
⚠️ 1003 - CmdPropAdd migrate local replication init cmd migrate local replication init added property is_preview
⚠️ 1001 - CmdAdd migrate local replication list cmd migrate local replication list added
⚠️ 1003 - CmdPropAdd migrate local replication new cmd migrate local replication new added property is_preview
⚠️ 1003 - CmdPropAdd migrate local replication remove cmd migrate local replication remove added property is_preview
⚠️ 1001 - CmdAdd migrate local start-migration cmd migrate local start-migration added

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 26, 2025

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

@github-actions
Copy link
Contributor

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
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 pull request adds new replication management commands and resolves preview versioning issues for the Azure Migrate Local extension. The version is bumped from 3.0.0b1 to 4.0.0b1 to introduce new functionality for listing, retrieving, and starting migration of replicating servers.

Key changes:

  • Added three new commands: az migrate local replication list, az migrate local replication get, and az migrate local start-migration
  • Fixed several bugs related to enum value access, custom location region retrieval, and AMH solution configuration
  • Added comprehensive unit tests (~4000+ lines) covering all new and existing functionality
  • Enhanced extension configuration matching logic to detect and update mismatched configurations

Reviewed changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated no comments.

Show a summary per file
File Description
setup.py Version bump from 3.0.0b1 to 4.0.0b1
test_migrate_commands.py Added extensive unit tests for new list, get, and start-migration commands
custom.py Implemented new command functions and removed redundant docstrings
commands.py Added new command registrations with preview flag
_params.py Added parameter definitions for new commands
_help.py Added comprehensive help documentation for new commands
HISTORY.rst Added release notes for 4.0.0b1
helpers/replication/init/_setup_policy.py Fixed enum value access by adding .value
helpers/replication/init/_setup_permissions.py Fixed AMH solution tool name update logic
helpers/replication/init/_setup_extension.py Enhanced configuration matching and update logic
helpers/replication/new/_validate.py Fixed return value to include subscription_id
helpers/replication/new/_execute_new.py Added custom location region retrieval and target RG creation
helpers/replication/list/_execute_list.py New module for listing protected items
helpers/replication/get/_execute_get.py New module for retrieving protected item details
helpers/migration/start/*.py New modules for migration validation, parsing, and execution
Various init.py files Added copyright headers to new module init files

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 27, 2025

Please fix CI issues

@wangzelin007
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 9493 in repo Azure/azure-cli-extensions

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 30, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

* Create extension

* Update src/migrate/azext_migrate/__init__.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix import issues

* Update src/migrate/setup.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Small

* Small lint

* Small

* disable lint for this check

* Add json

* Fix licesnse issue

* fix small

* Small

* Get rid of unused variables

* Add service name and code owner

* New version

* Style

* Small

* Update

* Follow standard

* Add suggestions

* Small

* Not preview

* Add flag to become experimental

* Update history

* Fix

* small

* Create get job and remove replication commands

* Add better error handling for jobs command

* Add better messages to remove protected item

* Return job id in remove command

* Move helpers

* Rename get discovered server helper

* Refactor _initialize_replication_infrastructure_helpers

* Refactor new replication

* Refactor jobs

* Refactor delete protected item

* Fix lint issues

* Change release version

* Fix lint issues

* Add fix

* Updae correct version

* Put beta version before

* Fix

* Update

* Fix bifurcation tool issue

* Update amh correctly if not proper

* Use current subscription id if not passed in

* Fix correct location and target resource group creation

* Create list protected items command

* Update versions

* Add __init__.py to all folders

* Create unit tests for get replication

* Update readme with accurate description of commands

* Update readme

* Create tests for jobs and remove commands

* Add more tests to increase coverage to 74%

* Add start migration command

* Address fixes

* Remove doc strings from custom.py

* Add init

* Remove old file locations

* fix failing tests

* Fix secret test

* Fix test

* Fix secret detection

* Fix duplicates

---------

Co-authored-by: Saif Al-Din Ali <saifaldinali@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@wangzelin007
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@wangzelin007 wangzelin007 merged commit 97b174d into Azure:main Dec 31, 2025
21 of 24 checks passed
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ migrate-3.0.0b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=147998404&view=results

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.

7 participants