ArmComputeModelFactory.VirtualMachineRunCommandScriptSource Method

Definition

public static Azure.ResourceManager.Compute.Models.VirtualMachineRunCommandScriptSource VirtualMachineRunCommandScriptSource(string script = default, Uri scriptUri = default, string commandId = default, Azure.ResourceManager.Compute.Models.RunCommandManagedIdentity scriptUriManagedIdentity = default, Azure.ResourceManager.Compute.Models.ScriptShellType? scriptShell = default, string galleryScriptReferenceId = default);
static member VirtualMachineRunCommandScriptSource : string * Uri * string * Azure.ResourceManager.Compute.Models.RunCommandManagedIdentity * Nullable<Azure.ResourceManager.Compute.Models.ScriptShellType> * string -> Azure.ResourceManager.Compute.Models.VirtualMachineRunCommandScriptSource
Public Shared Function VirtualMachineRunCommandScriptSource (Optional script As String = Nothing, Optional scriptUri As Uri = Nothing, Optional commandId As String = Nothing, Optional scriptUriManagedIdentity As RunCommandManagedIdentity = Nothing, Optional scriptShell As Nullable(Of ScriptShellType) = Nothing, Optional galleryScriptReferenceId As String = Nothing) As VirtualMachineRunCommandScriptSource

Parameters

script
String

Specifies the script content to be executed on the VM.

scriptUri
Uri

Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.

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.

scriptUriManagedIdentity
RunCommandManagedIdentity

User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged.

scriptShell
Nullable<ScriptShellType>

Optional. Specify which shell to use for running the script. These values must match those expected by the extension. Currently supported only for Windows VMs, script uses Powershell 7 when specified. Powershell 7 must be already installed on the machine to use Powershell7 parameter value.

galleryScriptReferenceId
String

The resource ID of a Gallery Script version that needs to be executed. Example ID looks like /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/galleries/{galleryName}/scripts/{scriptName}/versions/{version}.

Returns

A new VirtualMachineRunCommandScriptSource instance for mocking.

Applies to