Azure Managed Run Commands stuck in Deleting and Pending on Windows Server 2008 R2 VM

Jason Setzer 0 Reputation points
2026-09-02T16:57:55.1833333+00:00

We have an Azure Windows VM running Windows Server 2008 R2 Datacenter. The VM is Running and the Azure Guest Agent reports Ready (version 2.7.41491.1225).

A completed managed Run Command is stuck in provisioningState=Deleting. A separate managed Run Command is stuck in provisioningState=Creating with executionState=Pending and no start time, end time, or error.

Azure portal diagnostics report:

  • Extension diagnostics: no issues detected
  • Agent health diagnostics: no issues detected
  • Operation failure: VirtualMachines_RunCommand_POST failed with the conflict, "run command extension execution is in progress. please wait for completion before invoking a run command."

The completed command's guest script failed an application-level validation and rolled back its file change. The command nevertheless reported executionState=Succeeded and exit code 0. Its managed command child resource then remained in Deleting. Delete requests were accepted, but the control-plane state has not reconciled.

We have stopped submitting commands and have not restarted, deallocated, reapplied, resized, or modified the VM agent.

Questions:

  1. Is managed or action Run Command supported on Windows Server 2008 R2, given that current Microsoft documentation lists Windows Server 2016 and later?
  2. Is there a supported way to reconcile orphaned Run Command child resources without restarting, deallocating, reapplying, or changing the VM?
  3. How can we confirm from platform or guest-agent telemetry whether the Pending command can still execute later?
  4. When is it safe to submit one new idempotent Run Command?

We can provide resource IDs, command names, timestamps, and Activity Log correlation IDs privately to Microsoft Support, but do not want to post them publicly.

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 7,585 Reputation points
    2026-09-02T19:41:48.4366667+00:00

    Hello @Jason Setzer

    The key issue here is OS support. Microsoft's current documentation lists Windows Server 2016 and later as supported for both Managed Run Command and Action Run Command. Windows Server 2008 R2 is not in the supported OS list, even if the Azure Guest Agent currently reports Ready.

    The Deleting/Creating + Pending combination, along with “run command extension execution is in progress,” suggests the Run Command control-plane/agent state hasn't reconciled. Normally, Managed Run Command exposes ProvisioningState for extension provisioning and InstanceView.ExecutionState for the actual script execution.

    Since you've deliberately avoided restarting, deallocating, reapplying, or modifying the agent, do not submit another Run Command yet. The platform is already reporting an execution in progress, so another request could further complicate the state.

    Since this is Windows Server 2008 R2 and the documented Run Command prerequisites no longer include it, I recommend opening an Azure VM support case and privately providing the resource IDs, Run Command names, timestamps, and Activity Log correlation IDs. Ask Microsoft to verify whether the orphaned Run Command resources can be reconciled from the backend and whether the Pending execution can still be dispatched.

    Do not restart/reinstall the VM Agent solely to clear this condition until Microsoft reviews it, particularly on this legacy OS.

    References:

    Managed Run Command for Windows VMs

    Action Run Command for Windows VMs

    Help make this community better for everyone: if this answer resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.