Skip to main content

variables

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

Overview

Namevariables
TypeResource
Idazure.automation.variables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
propertiesobjectGets or sets the properties of the variable.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, automationAccountName, variableName, subscriptionIdRetrieve the variable identified by variable name.
list_by_automation_accountselectresourceGroupName, automationAccountName, subscriptionIdRetrieve a list of variables.
create_or_updateinsertresourceGroupName, automationAccountName, variableName, subscriptionId, data__name, data__propertiesCreate a variable.
updateupdateresourceGroupName, automationAccountName, variableName, subscriptionIdUpdate a variable.
deletedeleteresourceGroupName, automationAccountName, variableName, subscriptionIdDelete the variable.

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
automationAccountNamestringThe name of the automation account.
resourceGroupNamestringName of an Azure Resource group.
subscriptionIdstringGets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
variableNamestringThe name of variable.

SELECT examples

Retrieve the variable identified by variable name.

SELECT
properties
FROM azure.automation.variables
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND automationAccountName = '{{ automationAccountName }}' -- required
AND variableName = '{{ variableName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

Create a variable.

INSERT INTO azure.automation.variables (
data__name,
data__properties,
resourceGroupName,
automationAccountName,
variableName,
subscriptionId
)
SELECT
'{{ name }}' /* required */,
'{{ properties }}' /* required */,
'{{ resourceGroupName }}',
'{{ automationAccountName }}',
'{{ variableName }}',
'{{ subscriptionId }}'
RETURNING
properties
;

UPDATE examples

Update a variable.

UPDATE azure.automation.variables
SET
data__name = '{{ name }}',
data__properties = '{{ properties }}'
WHERE
resourceGroupName = '{{ resourceGroupName }}' --required
AND automationAccountName = '{{ automationAccountName }}' --required
AND variableName = '{{ variableName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
RETURNING
properties;

DELETE examples

Delete the variable.

DELETE FROM azure.automation.variables
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND automationAccountName = '{{ automationAccountName }}' --required
AND variableName = '{{ variableName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;