virtual_machine_scale_set_vm_run_commands
Creates, updates, deletes, gets or lists a virtual_machine_scale_set_vm_run_commands resource.
Overview
| Name | virtual_machine_scale_set_vm_run_commands |
| Type | Resource |
| Id | azure.compute.virtual_machine_scale_set_vm_run_commands |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
asyncExecution | boolean | Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. |
errorBlobManagedIdentity | object | User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' 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 _. |
errorBlobUri | string | Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. |
instanceView | object | The virtual machine run command instance view. |
location | string | The geo-location where the resource lives. Required. |
outputBlobManagedIdentity | object | User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' 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 _. |
outputBlobUri | string | Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. |
parameters | array | The parameters used by the script. |
protectedParameters | array | The parameters used by the script. |
provisioningState | string | The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results _. |
runAsPassword | string | Specifies the user account password on the VM when executing the run command. |
runAsUser | string | Specifies the user account on the VM when executing the run command. |
source | object | The source of the run command script. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
timeoutInSeconds | integer | The timeout in seconds to execute the run command. |
treatFailureAsDeploymentFailure | boolean | Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results _. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
asyncExecution | boolean | Optional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete. |
errorBlobManagedIdentity | object | User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' 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 _. |
errorBlobUri | string | Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. |
instanceView | object | The virtual machine run command instance view. |
location | string | The geo-location where the resource lives. Required. |
outputBlobManagedIdentity | object | User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' 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 _. |
outputBlobUri | string | Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. |
parameters | array | The parameters used by the script. |
protectedParameters | array | The parameters used by the script. |
provisioningState | string | The provisioning state, which only appears in the response. If treatFailureAsDeploymentFailure set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If treatFailureAsDeploymentFailure set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results _. |
runAsPassword | string | Specifies the user account password on the VM when executing the run command. |
runAsUser | string | Specifies the user account on the VM when executing the run command. |
source | object | The source of the run command script. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
timeoutInSeconds | integer | The timeout in seconds to execute the run command. |
treatFailureAsDeploymentFailure | boolean | Optional. If set to true, any failure in the script will fail the deployment and ProvisioningState will be marked as Failed. If set to false, ProvisioningState would only reflect whether the run command was run or not by the extensions platform, it would not indicate whether script failed in case of script failures. See instance view of run command in case of script failures to see executionMessage, output, error: https://aka.ms/runcommandmanaged#get-execution-status-and-results _. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
instance_id | string | The name of the VirtualMachineScaleSetVM. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
run_command_name | string | The name of the VirtualMachineRunCommand. Required. |
subscription_id | string | |
vm_scale_set_name | string | The name of the VirtualMachineScaleSet. Required. |
$expand | string | The expand expression to apply on the operation. Default value is None. |
SELECT examples
- get
- list
The operation to get the VMSS VM run command.
SELECT
id,
name,
asyncExecution,
errorBlobManagedIdentity,
errorBlobUri,
instanceView,
location,
outputBlobManagedIdentity,
outputBlobUri,
parameters,
protectedParameters,
provisioningState,
runAsPassword,
runAsUser,
source,
systemData,
tags,
timeoutInSeconds,
treatFailureAsDeploymentFailure,
type
FROM azure.compute.virtual_machine_scale_set_vm_run_commands
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' -- required
AND instance_id = '{{ instance_id }}' -- required
AND run_command_name = '{{ run_command_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
The operation to get all run commands of an instance in Virtual Machine Scaleset.
SELECT
id,
name,
asyncExecution,
errorBlobManagedIdentity,
errorBlobUri,
instanceView,
location,
outputBlobManagedIdentity,
outputBlobUri,
parameters,
protectedParameters,
provisioningState,
runAsPassword,
runAsUser,
source,
systemData,
tags,
timeoutInSeconds,
treatFailureAsDeploymentFailure,
type
FROM azure.compute.virtual_machine_scale_set_vm_run_commands
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' -- required
AND instance_id = '{{ instance_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $expand = '{{ $expand }}'
;
INSERT examples
- create_or_update
- Manifest
The operation to create or update the VMSS VM run command.
INSERT INTO azure.compute.virtual_machine_scale_set_vm_run_commands (
tags,
location,
properties,
resource_group_name,
vm_scale_set_name,
instance_id,
run_command_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ resource_group_name }}',
'{{ vm_scale_set_name }}',
'{{ instance_id }}',
'{{ run_command_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: virtual_machine_scale_set_vm_run_commands
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the virtual_machine_scale_set_vm_run_commands resource.
- name: vm_scale_set_name
value: "{{ vm_scale_set_name }}"
description: Required parameter for the virtual_machine_scale_set_vm_run_commands resource.
- name: instance_id
value: "{{ instance_id }}"
description: Required parameter for the virtual_machine_scale_set_vm_run_commands resource.
- name: run_command_name
value: "{{ run_command_name }}"
description: Required parameter for the virtual_machine_scale_set_vm_run_commands resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the virtual_machine_scale_set_vm_run_commands resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
Describes the properties of a Virtual Machine run command.
value:
source:
script: "{{ script }}"
scriptUri: "{{ scriptUri }}"
commandId: "{{ commandId }}"
scriptUriManagedIdentity:
clientId: "{{ clientId }}"
objectId: "{{ objectId }}"
scriptShell: "{{ scriptShell }}"
galleryScriptReferenceId: "{{ galleryScriptReferenceId }}"
parameters:
- name: "{{ name }}"
value: "{{ value }}"
protectedParameters:
- name: "{{ name }}"
value: "{{ value }}"
asyncExecution: {{ asyncExecution }}
runAsUser: "{{ runAsUser }}"
runAsPassword: "{{ runAsPassword }}"
timeoutInSeconds: {{ timeoutInSeconds }}
outputBlobUri: "{{ outputBlobUri }}"
errorBlobUri: "{{ errorBlobUri }}"
outputBlobManagedIdentity:
clientId: "{{ clientId }}"
objectId: "{{ objectId }}"
errorBlobManagedIdentity:
clientId: "{{ clientId }}"
objectId: "{{ objectId }}"
provisioningState: "{{ provisioningState }}"
instanceView:
executionState: "{{ executionState }}"
executionMessage: "{{ executionMessage }}"
exitCode: {{ exitCode }}
output: "{{ output }}"
error: "{{ error }}"
startTime: "{{ startTime }}"
endTime: "{{ endTime }}"
statuses:
- code: "{{ code }}"
level: "{{ level }}"
displayStatus: "{{ displayStatus }}"
message: "{{ message }}"
time: "{{ time }}"
treatFailureAsDeploymentFailure: {{ treatFailureAsDeploymentFailure }}
UPDATE examples
- update
The operation to update the VMSS VM run command.
UPDATE azure.compute.virtual_machine_scale_set_vm_run_commands
SET
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' --required
AND instance_id = '{{ instance_id }}' --required
AND run_command_name = '{{ run_command_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
The operation to create or update the VMSS VM run command.
REPLACE azure.compute.virtual_machine_scale_set_vm_run_commands
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' --required
AND instance_id = '{{ instance_id }}' --required
AND run_command_name = '{{ run_command_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
The operation to delete the VMSS VM run command.
DELETE FROM azure.compute.virtual_machine_scale_set_vm_run_commands
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND vm_scale_set_name = '{{ vm_scale_set_name }}' --required
AND instance_id = '{{ instance_id }}' --required
AND run_command_name = '{{ run_command_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;