variables
Creates, updates, deletes, gets or lists a variables resource.
Overview
| Name | variables |
| Type | Resource |
| Id | azure.resource.variables |
Fields
The following fields are returned by SELECT queries:
- get
- get_at_management_group
- list
- list_for_management_group
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
columns | array | Variable column definitions. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
columns | array | Variable column definitions. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
columns | array | Variable column definitions. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
columns | array | Variable column definitions. Required. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | variable_name, subscription_id | Retrieves a variable. This operation retrieves a single variable, given its name and the subscription it was created at. | |
get_at_management_group | select | management_group_id, variable_name | Retrieves a variable. This operation retrieves a single variable, given its name and the management group it was created at. | |
list | select | subscription_id | Retrieves all variables that are at this subscription level. This operation retrieves the list of all variables associated with the given subscription. | |
list_for_management_group | select | management_group_id | Retrieves all variables that are at this management group level. This operation retrieves the list of all variables applicable to the management group. | |
create_or_update | insert | variable_name, subscription_id | 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. | |
create_or_update_at_management_group | insert | management_group_id, variable_name | Creates 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_update | replace | variable_name, subscription_id | 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. | |
create_or_update_at_management_group | replace | management_group_id, variable_name | Creates 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. | |
delete | delete | variable_name, subscription_id | 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_at_management_group | delete | management_group_id, variable_name | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
management_group_id | string | The ID of the management group. Required. |
subscription_id | string | |
variable_name | string | The name of the variable to operate on. Required. |
SELECT examples
- get
- get_at_management_group
- list
- list_for_management_group
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
;
Retrieves a variable. This operation retrieves a single variable, given its name and the management group it was created at.
SELECT
id,
name,
columns,
systemData,
type
FROM azure.resource.variables
WHERE management_group_id = '{{ management_group_id }}' -- required
AND variable_name = '{{ variable_name }}' -- required
;
Retrieves all variables that are at this subscription level. This operation retrieves the list of all variables associated with the given subscription.
SELECT
id,
name,
columns,
systemData,
type
FROM azure.resource.variables
WHERE subscription_id = '{{ subscription_id }}' -- required
;
Retrieves all variables that are at this management group level. This operation retrieves the list of all variables applicable to the management group.
SELECT
id,
name,
columns,
systemData,
type
FROM azure.resource.variables
WHERE management_group_id = '{{ management_group_id }}' -- required
;
INSERT examples
- create_or_update
- create_or_update_at_management_group
- Manifest
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
;
Creates 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.
INSERT INTO azure.resource.variables (
properties,
management_group_id,
variable_name
)
SELECT
'{{ properties }}',
'{{ management_group_id }}',
'{{ variable_name }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: variables
props:
- name: variable_name
value: "{{ variable_name }}"
description: Required parameter for the variables resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the variables resource.
- name: management_group_id
value: "{{ management_group_id }}"
description: Required parameter for the variables resource.
- name: properties
description: |
Properties for the variable.
value:
columns:
- columnName: "{{ columnName }}"
REPLACE examples
- create_or_update
- create_or_update_at_management_group
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;
Creates 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.
REPLACE azure.resource.variables
SET
properties = '{{ properties }}'
WHERE
management_group_id = '{{ management_group_id }}' --required
AND variable_name = '{{ variable_name }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
- delete_at_management_group
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
;
Deletes 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}'.
DELETE FROM azure.resource.variables
WHERE management_group_id = '{{ management_group_id }}' --required
AND variable_name = '{{ variable_name }}' --required
;