Repository navigation
Migrate Extension: Add local runbook execution support - #10596
Harshit Surana (hsurana06) wants to merge 5 commits into
Conversation
Support opt-in loopback execution start, lifecycle controls, step actions, and live visualization. Retry transient Windows file replacement failures during HTML updates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
Missing cloud-identity validation allows malformed ARM requests, and local visualization generates control commands with unresolved placeholders that cannot be run for the displayed execution.
2 open issues
What changed in this PR
Adds opt-in local runbook execution to the Azure Migrate CLI extension, reusing its status and visualization features, and releases version 3.0.0b8.
Changes:
- Adds a loopback-only execution client with lifecycle controls and step actions, separate from ARM authentication.
- Integrates local execution with status polling and live visualization.
- Retries transient Windows file-replacement failures and adds regression tests.
| File | Description |
|---|---|
src/migrate/setup.py |
Bumps the extension version to 3.0.0b8. |
src/migrate/HISTORY.rst |
Records local execution and file-replacement improvements. |
src/migrate/docs/runbook-cli-design.md |
Documents the development execution client’s architecture. |
src/migrate/azext_migrate/tests/latest/runbook/test_runbook_unit.py |
Adds transport, command-routing, visualization, and file-retry tests. |
src/migrate/azext_migrate/shared/files.py |
Adds bounded retries for Windows file locks. |
src/migrate/azext_migrate/shared/execution_endpoint_client.py |
Implements loopback validation and execution REST requests. |
src/migrate/azext_migrate/runbook/cmds/execution.py |
Routes execution commands and visualization to the local endpoint when configured. |
src/migrate/azext_migrate/runbook/cmds/execution_step.py |
Adds local approval, retry, and manual-completion actions. |
Review effort: Balanced
Validate required cloud runbook arguments before constructing ARM IDs and preserve local execution context in snapshot and watch command chips. Add regression tests for both PR review fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Move release notes under Upcoming and restore the existing 3.0.0b7 package version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Updated History.rst to document the changes introduced in this PR. The setup.py version has not been updated, as the release will be handled separately. |
| (synchronously, or carried in the async operation status). | ||
| """ | ||
| endpoint = os.environ.get('AZURE_MIGRATE_EXECUTION_ENDPOINT') | ||
| if endpoint: |
There was a problem hiding this comment.
pls add log line for end user in cmdline to inform user regarding dev endpoint selection.
There was a problem hiding this comment.
krdhruva - Instead of repeating the log in this file, have moved the log for endpoint in the ExecutionEndpointClient which is invoked for all the paths where we have endpoint set for local execution.
logger.warning('Using the configured development execution endpoint.') logger.debug('Development execution endpoint: %s', self.endpoint)
Is the suggestion here to add it as logger info instead of warning or debug log?
There was a problem hiding this comment.
Debug would not visible by default. Let's ensure this is visible as msg on cli window without --debug flag passed as well.
There was a problem hiding this comment.
krdhruva - Added local endpoint in warning which is visible without debug or verbose flag.

| if not context: | ||
| return cmd | ||
| for token, key in _CMD_CONTEXT_TOKENS: | ||
| for option, token, key in _CMD_CONTEXT_TOKENS: |
There was a problem hiding this comment.
Is local endpoint unauthenticated? are we removing token header here?
There was a problem hiding this comment.
Made the change to address the following review comment - #10596 (comment)
| =============== | ||
|
|
||
| Upcoming | ||
| +++++++++++++++ |
There was a problem hiding this comment.
Do we need to add this in release history?
There was a problem hiding this comment.
Agreed, this change is not user facing and can be omitted from release history. Will revert this change for now.
There was a problem hiding this comment.
Removed from History.rst
Restore HISTORY.rst to match main; defer release notes until publication. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Include the validated endpoint URL in the centralized warning and cover default-level visibility, repeated status calls and rejected endpoints. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Note for reviewers:
|

🤖 PR Validation —⚠️ Review suggested
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
2 added suppressions
src/migrate/azext_migrate/runbook/cmds/execution.pyinterval, fetch_status=None): # pragma: no cover - interactive polling loopsrc/migrate/azext_migrate/runbook/cmds/execution.pycontext=None, fetch_status=None): # pragma: no cover - interactive loopSupport opt-in loopback execution start, lifecycle controls, step actions, and live visualization. Retry transient Windows file replacement failures during HTML updates.
Update the migrate extension to
3.0.0b8.This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az migrate runbook execution startaz migrate runbook execution showaz migrate runbook execution visualize --watchaz migrate runbook execution pauseaz migrate runbook execution resumeaz migrate runbook execution cancelaz migrate runbook execution step approveaz migrate runbook execution step retryaz migrate runbook execution step completeGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)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.jsonautomatically.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.