Skip to content

[connectedmachine] Fix run-command create/update stuck in provisioningState Creating - #9985

Draft
Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-connectedmachine-run-command-stuck
Draft

[connectedmachine] Fix run-command create/update stuck in provisioningState Creating#9985
Aditya Pujara (a0x1ab) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-connectedmachine-run-command-stuck

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

az connectedmachine run-command create (and update) returned with provisioningState: Creating because the ARM async-operation URL reports Succeeded at the ARM layer before the connected-machine agent finishes executing the script. The LRO completed, the CLI returned, but the resource was still in a non-terminal state.

Changes

  • custom.py – Added RunCommandCreate and RunCommandUpdate overrides that hook post_operations to poll the resource via GET until provisioningState reaches a terminal state (Succeeded / Failed / Canceled). Respects --no-wait. Reuses MachineRunCommandsGet from the generated Update command.
  • commands.py – Registered both overrides to replace the auto-generated AAZ create and update commands.

Related command

az connectedmachine run-command create
az connectedmachine run-command update

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? (azdev required; see .azure-pipelines/templates/azdev_setup.yml for the install command until azdev==0.2.11b1 is on PyPI)
  • 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.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 22, 2026

Copy link
Copy Markdown
️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Copilot,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

Override the `create` and `update` commands to poll the resource via GET
until provisioningState reaches a terminal state (Succeeded/Failed/Canceled).

The ARM async-operation for run-command may report success before the
connected-machine agent finishes executing the script. This causes the
CLI to return with provisioningState "Creating". The override adds a
post_operations hook that polls the resource URL until a terminal state
is reached, fixing the stuck behavior.
Copilot AI changed the title [WIP] Fix az connectedmachine run-command stuck in provisioningState creating [connectedmachine] Fix run-command create/update stuck in provisioningState Creating Jun 22, 2026
@yonzhan

Copy link
Copy Markdown
Collaborator

connectedmachine

@a0x1ab Aditya Pujara (a0x1ab) added azure-client-tools-agent Pull request commented on or reviewed by Azure Client Tools Agent and removed azure-client-tools-agent Pull request commented on or reviewed by Azure Client Tools Agent labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants