Skip to main content

virtual_machine_run_commands

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

Overview

Namevirtual_machine_run_commands
TypeResource
Idazure.compute.virtual_machine_run_commands

Fields

NameDatatypeDescription
idtextResource Id
namestringResource name
async_executiontextfield from the properties object
error_blob_managed_identitytextfield from the properties object
error_blob_uritextfield from the properties object
instance_viewtextfield from the properties object
locationstringResource location
output_blob_managed_identitytextfield from the properties object
output_blob_uritextfield from the properties object
parameterstextfield from the properties object
protected_parameterstextfield from the properties object
provisioning_statetextfield from the properties object
resourceGroupNametextfield from the properties object
runCommandNametextfield from the properties object
run_as_passwordtextfield from the properties object
run_as_usertextfield from the properties object
sourcetextfield from the properties object
subscriptionIdtextfield from the properties object
tagsobjectResource tags
timeout_in_secondstextfield from the properties object
treat_failure_as_deployment_failuretextfield from the properties object
typestringResource type
vmNametextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTcommandId, location, subscriptionIdGets specific run command for a subscription in a location.
get_by_virtual_machineSELECTresourceGroupName, runCommandName, subscriptionId, vmNameThe operation to get the run command.
listSELECTlocation, subscriptionIdLists all available run commands for a subscription in a location.
list_by_virtual_machineSELECTresourceGroupName, subscriptionId, vmNameThe operation to get all run commands of a Virtual Machine.
create_or_updateINSERTresourceGroupName, runCommandName, subscriptionId, vmNameThe operation to create or update the run command.
deleteDELETEresourceGroupName, runCommandName, subscriptionId, vmNameThe operation to delete the run command.
updateUPDATEresourceGroupName, runCommandName, subscriptionId, vmNameThe operation to update the run command.

SELECT examples

Lists all available run commands for a subscription in a location.

SELECT
id,
name,
async_execution,
error_blob_managed_identity,
error_blob_uri,
instance_view,
location,
output_blob_managed_identity,
output_blob_uri,
parameters,
protected_parameters,
provisioning_state,
resourceGroupName,
runCommandName,
run_as_password,
run_as_user,
source,
subscriptionId,
tags,
timeout_in_seconds,
treat_failure_as_deployment_failure,
type,
vmName
FROM azure.compute.vw_virtual_machine_run_commands
WHERE location = '{{ location }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new virtual_machine_run_commands resource.

/*+ create */
INSERT INTO azure.compute.virtual_machine_run_commands (
resourceGroupName,
runCommandName,
subscriptionId,
vmName,
properties,
location,
tags
)
SELECT
'{{ resourceGroupName }}',
'{{ runCommandName }}',
'{{ subscriptionId }}',
'{{ vmName }}',
'{{ properties }}',
'{{ location }}',
'{{ tags }}'
;

UPDATE example

Updates a virtual_machine_run_commands resource.

/*+ update */
UPDATE azure.compute.virtual_machine_run_commands
SET
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}'
AND runCommandName = '{{ runCommandName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vmName = '{{ vmName }}';

DELETE example

Deletes the specified virtual_machine_run_commands resource.

/*+ delete */
DELETE FROM azure.compute.virtual_machine_run_commands
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND runCommandName = '{{ runCommandName }}'
AND subscriptionId = '{{ subscriptionId }}'
AND vmName = '{{ vmName }}';