question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQ] Adding managed RunCommand capabilities

See original GitHub issue

Library name

Azure.ResourceManager.Compute

Please describe the feature.

There is an Azure Compute feature in public preview right now which allows naming of RunCommand execution and retrieval of the status of the RunCommand. https://docs.microsoft.com/en-us/azure/virtual-machines/linux/run-command-managed.

  1. Currently, there is no method from VirtualMachineResource to deploy a managed run command (hitting the PUT /subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Compute/virtualMachines/<vmName>/runcommands/<runCommandName> endpoint). I would like to request this feature to be added as an instance method to VirtualMachineResource.

  2. The current GetVirtualMachineRunCommand and GetVirtualMachineRunCommandAsync methods can properly retrieve the status of the managed RunCommand. These methods can also expand the instanceView which contains the execution output results as long as the expand argument is equal to "instanceView". I saw this after sending my own PUT request to the endpoint I mentioned in point (1) using "TestingRunCommand" as the runCommandName and "echo 'Hello'" as the script in the request body.

    However, the plural method GetVirtualMachineRunCommands has no expand parameter and there is no GetVirtualMachineRunCommandsAsync method at all. I would like to request that the expand parameter be added and that GetVirtualMachineRunCommandsAsync be added as well.

I am in need of this feature as I am building a DevOps service for the Azure Postgres team which will deploy and retrieve the status of these managed scripts. It is necessary for the service to know whether the script execution succeeded and the output of the script execution; this data is contained in the expanded instanceView portion of the GetVirtualMachineRunCommand data. However, it is important that deploying the RunCommand and retrieiving the status can be done asynchronously in case of a server failure. Currently, if the RunCommand is executed, but the service fails there is no way of knowing whether a particular virtual machine executed the RunCommand. We are trying to keep this DevOps service stateless, so enabling these features would be very helpful.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ArthurMa1978commented, Jul 8, 2022

Hi @samir-puranik , yes, we will support it soon in the stable release this month.

0reactions
github-actions[bot]commented, May 22, 2023

Hi @samir-puranik. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run scripts in a Windows VM in Azure using action ...
This article describes how to run PowerShell scripts within an Azure Windows virtual machine by using the Run Command feature.
Read more >
Run a command on a managed instance
An array of search criteria that targets instances by using a Key,Value combination that you specify. Targets is required if you don't provide...
Read more >
Azure Run Command for Dummies
The Azure Run Command feature enables administrators to run commands on Azure Windows or Linux virtual machines by leveraging the virtual ...
Read more >
How to run scripts against multiple Azure VMs by using ...
How you can run scripts against multiple Azure virtual machines (VMs) by using PowerShell and the Invoke-AzVMRunCommand feature.
Read more >
Running Commands on an Instance
You can remotely configure, manage, and troubleshoot compute instances by running scripts within the instance using the run command feature.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found