MockableComputeSubscriptionResource.GetVirtualMachineRunCommand Method

Definition

Gets specific run command for a subscription in a location.

  • Request Path. : /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}.
  • Operation Id. : VirtualMachineRunCommandsOperationGroup_Get.
  • Default Api Version. : 2025-11-01.
public virtual Azure.Response<Azure.ResourceManager.Compute.Models.RunCommandDocument> GetVirtualMachineRunCommand(Azure.Core.AzureLocation location, string commandId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetVirtualMachineRunCommand : Azure.Core.AzureLocation * string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.Compute.Models.RunCommandDocument>
override this.GetVirtualMachineRunCommand : Azure.Core.AzureLocation * string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.Compute.Models.RunCommandDocument>
Public Overridable Function GetVirtualMachineRunCommand (location As AzureLocation, commandId As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of RunCommandDocument)

Parameters

location
AzureLocation

The name of the Azure region.

commandId
String

Specifies a commandId of predefined built-in script. Command IDs available for Linux are listed at https://aka.ms/RunCommandManagedLinux#available-commands, Windows at https://aka.ms/RunCommandManagedWindows#available-commands.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

commandId is null.

commandId is an empty string, and was expected to be non-empty.

Applies to