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

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringResource Id
namestringResource name
locationstringResource location
propertiesobjectDescribes the properties of a Virtual Machine run command.
tagsobjectResource tags
typestringResource type

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_virtual_machineselectresourceGroupName, vmName, runCommandName, subscriptionId$expandThe operation to get the run command.
getselectlocation, commandId, subscriptionIdGets specific run command for a subscription in a location.
list_by_virtual_machineselectresourceGroupName, vmName, subscriptionId$expandThe operation to get all run commands of a Virtual Machine.
listselectlocation, subscriptionIdLists all available run commands for a subscription in a location.
create_or_updateinsertresourceGroupName, vmName, runCommandName, subscriptionIdThe operation to create or update the run command.
updateupdateresourceGroupName, vmName, runCommandName, subscriptionIdThe operation to update the run command.
deletedeleteresourceGroupName, vmName, runCommandName, subscriptionIdThe operation to delete the 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
commandIdstringThe command id.
locationstringThe location upon which run commands is queried.
resourceGroupNamestringThe name of the resource group.
runCommandNamestringThe name of the virtual machine run command.
subscriptionIdstringSubscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
vmNamestringThe name of the virtual machine where the run command should be deleted.
$expandstringThe expand expression to apply on the operation.

SELECT examples

The operation to get the run command.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.compute.virtual_machine_run_commands
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND vmName = '{{ vmName }}' -- required
AND runCommandName = '{{ runCommandName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $expand = '{{ $expand }}'
;

INSERT examples

The operation to create or update the run command.

INSERT INTO azure.compute.virtual_machine_run_commands (
data__properties,
data__location,
data__tags,
resourceGroupName,
vmName,
runCommandName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ location }}',
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ vmName }}',
'{{ runCommandName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

UPDATE examples

The operation to update the run command.

UPDATE azure.compute.virtual_machine_run_commands
SET
data__properties = '{{ properties }}',
data__tags = '{{ tags }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND vmName = '{{ vmName }}' --required
AND runCommandName = '{{ runCommandName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
id,
name,
location,
properties,
tags,
type;

DELETE examples

The operation to delete the run command.

DELETE FROM azure.compute.virtual_machine_run_commands
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND vmName = '{{ vmName }}' --required
AND runCommandName = '{{ runCommandName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;