ComputeExtensions.GetVirtualMachineRunCommandAsync Method

Definition

Gets specific run command for a subscription in a location. <item> Mocking. To mock this method, please mock GetVirtualMachineRunCommandAsync(AzureLocation, String, CancellationToken) instead. </item>

public static System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Compute.Models.RunCommandDocument>> GetVirtualMachineRunCommandAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string commandId, System.Threading.CancellationToken cancellationToken = default);
static member GetVirtualMachineRunCommandAsync : Azure.ResourceManager.Resources.SubscriptionResource * Azure.Core.AzureLocation * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Compute.Models.RunCommandDocument>>
<Extension()>
Public Function GetVirtualMachineRunCommandAsync (subscriptionResource As SubscriptionResource, location As AzureLocation, commandId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of RunCommandDocument))

Parameters

subscriptionResource
SubscriptionResource

The SubscriptionResource the method will execute against.

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 an empty string, and was expected to be non-empty.

subscriptionResource is null.

Applies to