Skip to content

Migrate Extension: Add local runbook execution support - #10596

Open
Harshit Surana (hsurana06) wants to merge 5 commits into
Azure:mainfrom
hsurana06:hsurana/runbook-localRunner-Exec
Open

Harshit Surana (hsurana06) wants to merge 5 commits into
Azure:mainfrom
hsurana06:hsurana/runbook-localRunner-Exec

Conversation

@hsurana06

@hsurana06 Harshit Surana (hsurana06) commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Suppressions
⚠️ None ⚠️ 2 added
⚠️Azure CLI Extensions Breaking Change Test
⚠️migrate
rule cmd_name rule_message suggest_message
⚠️ 1009 - ParaPropRemove migrate runbook execution cancel cmd migrate runbook execution cancel update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution cancel cmd migrate runbook execution cancel update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution cancel cmd migrate runbook execution cancel update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution list cmd migrate runbook execution list update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution list cmd migrate runbook execution list update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution list cmd migrate runbook execution list update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution pause cmd migrate runbook execution pause update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution pause cmd migrate runbook execution pause update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution pause cmd migrate runbook execution pause update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution resume cmd migrate runbook execution resume update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution resume cmd migrate runbook execution resume update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution resume cmd migrate runbook execution resume update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution show cmd migrate runbook execution show update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution show cmd migrate runbook execution show update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution show cmd migrate runbook execution show update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution start cmd migrate runbook execution start update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution start cmd migrate runbook execution start update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution start cmd migrate runbook execution start update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step approve cmd migrate runbook execution step approve update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step approve cmd migrate runbook execution step approve update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step approve cmd migrate runbook execution step approve update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step complete cmd migrate runbook execution step complete update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step complete cmd migrate runbook execution step complete update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step complete cmd migrate runbook execution step complete update parameter runbook_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step retry cmd migrate runbook execution step retry update parameter project_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step retry cmd migrate runbook execution step retry update parameter resource_group_name: removed property required=True
⚠️ 1009 - ParaPropRemove migrate runbook execution step retry cmd migrate runbook execution step retry update parameter runbook_name: removed property required=True

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
File Line Kind Code
src/migrate/azext_migrate/runbook/cmds/execution.py 320 coverage interval, fetch_status=None): # pragma: no cover - interactive polling loop
src/migrate/azext_migrate/runbook/cmds/execution.py 431 coverage context=None, fetch_status=None): # pragma: no cover - interactive loop

Support 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 start
  • az migrate runbook execution show
  • az migrate runbook execution visualize --watch
  • az migrate runbook execution pause
  • az migrate runbook execution resume
  • az migrate runbook execution cancel
  • az migrate runbook execution step approve
  • az migrate runbook execution step retry
  • az migrate runbook execution step complete

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 azdev 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.

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>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 09:36
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
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>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@hsurana06 Harshit Surana (hsurana06) changed the title Migrate Extension: Add local runbook execution support and release 3.0.0b8 Migrate Extension: Add local runbook execution support Nov 16, 2026
@hsurana06

Copy link
Copy Markdown
Member Author

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:

@krdhruva krdhruva Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pls add log line for end user in cmdline to inform user regarding dev endpoint selection.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

https://github.com/Azure/azure-cli-extensions/pull/10596/changes#:~:text=logger.warning(%27Using,%2C%20self.endpoint)

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Debug would not visible by default. Let's ensure this is visible as msg on cli window without --debug flag passed as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

krdhruva - Added local endpoint in warning which is visible without debug or verbose flag.
image

if not context:
return cmd
for token, key in _CMD_CONTEXT_TOKENS:
for option, token, key in _CMD_CONTEXT_TOKENS:

@krdhruva krdhruva Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is local endpoint unauthenticated? are we removing token header here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Made the change to address the following review comment - #10596 (comment)

Comment thread src/migrate/HISTORY.rst Outdated
===============

Upcoming
+++++++++++++++

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to add this in release history?

@hsurana06 Harshit Surana (hsurana06) Nov 16, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed, this change is not user facing and can be omitted from release history. Will revert this change for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
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>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@hsurana06

Copy link
Copy Markdown
Member Author

Note for reviewers:

  1. The two suppressions are existing, updating the signature line for the two functions where suppression existed is flagged in this PR as well.
  2. The changes in this PR are development improvements and do not change or add any new command/parameters. Release will be done post ignite, hence setup.py is not updated with new version.

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.

6 participants