azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

Multiple problems with https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command-managed

Open DarwinJS opened this issue 1 year ago • 1 comments

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.

DarwinJS avatar Jun 03 '23 01:06 DarwinJS

@DarwinJS Thanks for your feedback! We will investigate and update as appropriate.

SaibabaBalapur-MSFT avatar Jun 03 '23 06:06 SaibabaBalapur-MSFT

@DarwinJS I'm going to assign this to the document author so they can take a look at it accordingly.

@GabstaMSFT please review it.

SaibabaBalapur-MSFT avatar Jun 05 '23 08:06 SaibabaBalapur-MSFT

#reassign @nikhilpatel909

GabstaMSFT avatar Jun 06 '23 14:06 GabstaMSFT

@SaibabaBalapur-MSFT could you assign this to @nikhilpatel909 as he's owner of this product.

GabstaMSFT avatar Jun 23 '23 20:06 GabstaMSFT

@SaibabaBalapur-MSFT Ack and reviewing it

nikhilpatel909 avatar Jun 27 '23 17:06 nikhilpatel909

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

vivlingaiah avatar Jun 27 '23 23:06 vivlingaiah

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

akashdubey-ms avatar Feb 12 '24 14:02 akashdubey-ms