Skip to main content

virtual_machine_scale_set_vm_run_commands

Creates, updates, deletes, gets or lists a virtual_machine_scale_set_vm_run_commands resource.

Overview

Namevirtual_machine_scale_set_vm_run_commands
TypeResource
Idazure.compute.virtual_machine_scale_set_vm_run_commands

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
asyncExecutionbooleanOptional. If set to true, provisioning will complete as soon as the script starts and will not wait for script to complete.
errorBlobManagedIdentityobjectUser-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 _.
errorBlobUristringSpecifies 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.
instanceViewobjectThe virtual machine run command instance view.
locationstringThe geo-location where the resource lives. Required.
outputBlobManagedIdentityobjectUser-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 _.
outputBlobUristringSpecifies 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.
parametersarrayThe parameters used by the script.
protectedParametersarrayThe parameters used by the script.
provisioningStatestringThe 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 _.
runAsPasswordstringSpecifies the user account password on the VM when executing the run command.
runAsUserstringSpecifies the user account on the VM when executing the run command.
sourceobjectThe source of the run command script.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectResource tags.
timeoutInSecondsintegerThe timeout in seconds to execute the run command.
treatFailureAsDeploymentFailurebooleanOptional. 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 _.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, vm_scale_set_name, instance_id, run_command_name, subscription_id$expandThe operation to get the VMSS VM run command.
listselectresource_group_name, vm_scale_set_name, instance_id, subscription_id$expandThe operation to get all run commands of an instance in Virtual Machine Scaleset.
create_or_updateinsertresource_group_name, vm_scale_set_name, instance_id, run_command_name, subscription_id, locationThe operation to create or update the VMSS VM run command.
updateupdateresource_group_name, vm_scale_set_name, instance_id, run_command_name, subscription_idThe operation to update the VMSS VM run command.
create_or_updatereplaceresource_group_name, vm_scale_set_name, instance_id, run_command_name, subscription_id, locationThe operation to create or update the VMSS VM run command.
deletedeleteresource_group_name, vm_scale_set_name, instance_id, run_command_name, subscription_idThe operation to delete the VMSS VM run command.

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.

NameDatatypeDescription
instance_idstringThe name of the VirtualMachineScaleSetVM. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
run_command_namestringThe name of the VirtualMachineRunCommand. Required.
subscription_idstring
vm_scale_set_namestringThe name of the VirtualMachineScaleSet. Required.
$expandstringThe expand expression to apply on the operation. Default value is None.

SELECT examples

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 }}'
;

INSERT examples

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
;

UPDATE examples

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

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

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
;