VirtualMachineRunCommandScriptSource Class
- java.
lang. Object - com.
azure. resourcemanager. compute. models. VirtualMachineRunCommandScriptSource
- com.
Implements
public final class VirtualMachineRunCommandScriptSource
implements JsonSerializable<VirtualMachineRunCommandScriptSource>
Describes the script sources for run command. Use only one of script, scriptUri, commandId.
Constructor Summary
Constructor | Description |
---|---|
VirtualMachineRunCommandScriptSource() |
Creates an instance of Virtual |
Method Summary
Modifier and Type | Method and Description |
---|---|
String |
commandId()
Get the command |
static
Virtual |
fromJson(JsonReader jsonReader)
Reads an instance of Virtual |
String |
script()
Get the script property: Specifies the script content to be executed on the VM. |
String |
scriptUri()
Get the script |
Run |
scriptUriManagedIdentity()
Get the script |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Virtual |
withCommandId(String commandId)
Set the command |
Virtual |
withScript(String script)
Set the script property: Specifies the script content to be executed on the VM. |
Virtual |
withScriptUri(String scriptUri)
Set the script |
Virtual |
withScriptUriManagedIdentity(RunCommandManagedIdentity scriptUriManagedIdentity)
Set the script |
Methods inherited from java.lang.Object
Constructor Details
VirtualMachineRunCommandScriptSource
public VirtualMachineRunCommandScriptSource()
Creates an instance of VirtualMachineRunCommandScriptSource class.
Method Details
commandId
public String commandId()
Get the commandId property: Specifies a commandId of predefined built-in script.
Returns:
fromJson
public static VirtualMachineRunCommandScriptSource fromJson(JsonReader jsonReader)
Reads an instance of VirtualMachineRunCommandScriptSource from the JsonReader.
Parameters:
Returns:
Throws:
script
public String script()
Get the script property: Specifies the script content to be executed on the VM.
Returns:
scriptUri
public String scriptUri()
Get the scriptUri property: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.
Returns:
scriptUriManagedIdentity
public RunCommandManagedIdentity scriptUriManagedIdentity()
Get the scriptUriManagedIdentity property: 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.
Returns:
toJson
validate
public void validate()
Validates the instance.
withCommandId
public VirtualMachineRunCommandScriptSource withCommandId(String commandId)
Set the commandId property: Specifies a commandId of predefined built-in script.
Parameters:
Returns:
withScript
public VirtualMachineRunCommandScriptSource withScript(String script)
Set the script property: Specifies the script content to be executed on the VM.
Parameters:
Returns:
withScriptUri
public VirtualMachineRunCommandScriptSource withScriptUri(String scriptUri)
Set the scriptUri property: Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI.
Parameters:
Returns:
withScriptUriManagedIdentity
public VirtualMachineRunCommandScriptSource withScriptUriManagedIdentity(RunCommandManagedIdentity scriptUriManagedIdentity)
Set the scriptUriManagedIdentity property: 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.
Parameters:
Returns:
Applies to
Azure SDK for Java