Skip to main content

variables

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

Overview

Namevariables
TypeResource
Idazure.resource.variables

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.
columnsarrayVariable column definitions. Required.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
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
getselectvariable_name, subscription_idRetrieves a variable. This operation retrieves a single variable, given its name and the subscription it was created at.
get_at_management_groupselectmanagement_group_id, variable_nameRetrieves a variable. This operation retrieves a single variable, given its name and the management group it was created at.
listselectsubscription_idRetrieves all variables that are at this subscription level. This operation retrieves the list of all variables associated with the given subscription.
list_for_management_groupselectmanagement_group_idRetrieves all variables that are at this management group level. This operation retrieves the list of all variables applicable to the management group.
create_or_updateinsertvariable_name, subscription_idCreates or updates a variable. This operation creates or updates a variable with the given subscription and name. Policy variables can only be used by a policy definition at the scope they are created or below.
create_or_update_at_management_groupinsertmanagement_group_id, variable_nameCreates or updates a variable. This operation creates or updates a variable with the given management group and name. Policy variables can only be used by a policy definition at the scope they are created or below.
create_or_updatereplacevariable_name, subscription_idCreates or updates a variable. This operation creates or updates a variable with the given subscription and name. Policy variables can only be used by a policy definition at the scope they are created or below.
create_or_update_at_management_groupreplacemanagement_group_id, variable_nameCreates or updates a variable. This operation creates or updates a variable with the given management group and name. Policy variables can only be used by a policy definition at the scope they are created or below.
deletedeletevariable_name, subscription_idDeletes a variable. This operation deletes a variable, given its name and the subscription it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.
delete_at_management_groupdeletemanagement_group_id, variable_nameDeletes a variable. This operation deletes a variable, given its name and the management group it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.

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
management_group_idstringThe ID of the management group. Required.
subscription_idstring
variable_namestringThe name of the variable to operate on. Required.

SELECT examples

Retrieves a variable. This operation retrieves a single variable, given its name and the subscription it was created at.

SELECT
id,
name,
columns,
systemData,
type
FROM azure.resource.variables
WHERE variable_name = '{{ variable_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Creates or updates a variable. This operation creates or updates a variable with the given subscription and name. Policy variables can only be used by a policy definition at the scope they are created or below.

INSERT INTO azure.resource.variables (
properties,
variable_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ variable_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Creates or updates a variable. This operation creates or updates a variable with the given subscription and name. Policy variables can only be used by a policy definition at the scope they are created or below.

REPLACE azure.resource.variables
SET
properties = '{{ properties }}'
WHERE
variable_name = '{{ variable_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Deletes a variable. This operation deletes a variable, given its name and the subscription it was created in. The scope of a variable is the part of its ID preceding '/providers/Microsoft.Authorization/variables/{variableName}'.

DELETE FROM azure.resource.variables
WHERE variable_name = '{{ variable_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;