azure-docs
azure-docs copied to clipboard
Multiple problems with https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed
All from Azure CloudShell...
Item 1
A redirect to this page says you can now run multiple commands at once, but when I try to run more than one I get the error:
"(Conflict) Run command extension execution is in progress. Please wait for completion before invoking a run command. Code: Conflict Message: Run command extension execution is in progress. Please wait for completion before invoking a run command."
Item 2
Separately, here https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#list-all-deployed-runcommand-resources-on-a-vm it says "List all deployed RunCommand resources on a VM: This command will return a full list of previously deployed Run Commands along with their properties."
But when used as suggested the command responds:
"az vm run-command list --location westus2 Lists all available run commands for a subscription in a location. (autogenerated)"
Which implies it does not list the commands currently running on a VM.
Item 3
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#execute-a-script-with-the-vm shows how to execute a script using run command? I tried using the ID specified in the run-command for scripts and it does not work.
All the below commands are used to see status or delete a running command - but they all want a "command name" - which was not specified in the the run script command above - so there seems to be no way to managed scripts launched with that first command?
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#get-execution-status-and-results https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#delete-runcommand-resource-from-the-vm
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 04865202-8e09-967f-a7a7-b18ab6845b2e
- Version Independent ID: 73268057-c2f4-c7be-6149-a8172bf68e35
- Content: Run scripts in a Windows VM in Azure using managed Run Commands - Azure Virtual Machines
- Content Source: articles/virtual-machines/windows/run-command-managed.md
- Service: virtual-machines
- GitHub Login: @nikhilpatel909
- Microsoft Alias: erd
@DarwinJS Thanks for your feedback! We will investigate and update as appropriate.
@DarwinJS I'm going to assign this to the document author so they can take a look at it accordingly.
@GabstaMSFT please review it.
#reassign @nikhilpatel909
@SaibabaBalapur-MSFT could you assign this to @nikhilpatel909 as he's owner of this product.
@SaibabaBalapur-MSFT Ack and reviewing it
Hi @DarwinJS , Item1
Are you using Action Run command (Invoke-AzVMRunCommand) ? If yes, it does not support multiple run commands at a time. Please use managed run command (multiple Set-AzVMRunCommand cmdlet executions with different Run Command names) to be able to use multiple run commands at a time. Please refer https://aka.ms/RunCommandManagedWindows or https://aka.ms.RunCommandManagedLinux for examples.
Item2
the below case is not supported at this time. Lists all available run commands for a subscription in a location. (autogenerated)
You'd be able to list all run commands on a VM however. You can try below for example to list all run commands on a VM. Get-AzVMRunCommand -ResourceGroupName MyRG0 -VMName MyVMWCUS1
Item3
You can pass an inline script to the cmdlet Set-AzVMRunCommand using the -SourceScript parameter like the example https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#execute-a-script-with-the-vm
OR
use save your script in an Azure storage blob and use a SAS URL with read access. Example is: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed#execute-a-script-on-the-vm-using-sourcescripturi-parameter
Thanks for your contribution to our documentation
We sincerely apologize for the delayed response. Unfortunately, we have been unable to review this issue in a timely manner. However, we are making overall enhancements to our content. We are closing this issue for now as there has been no activity for a while. If you feel that the problem persists, please respond to this issue with additional information. ? Please continue to provide feedback about the documentation. We appreciate your contributions to our community.
#please-close