variable
Creates, updates, deletes, gets or lists a variable resource.
Overview
| Name | variable |
| Type | Resource |
| Id | azure.automation.variable |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_automation_account
| 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. |
creationTime | string (date-time) | Gets or sets the creation time. |
description | string | Gets or sets the description. |
isEncrypted | boolean | Gets or sets the encrypted flag of the variable. |
lastModifiedTime | string (date-time) | Gets or sets the last modified time. |
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". |
value | string | Gets or sets the value of the variable. |
| 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. |
creationTime | string (date-time) | Gets or sets the creation time. |
description | string | Gets or sets the description. |
isEncrypted | boolean | Gets or sets the encrypted flag of the variable. |
lastModifiedTime | string (date-time) | Gets or sets the last modified time. |
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". |
value | string | Gets or sets the value of the variable. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, automation_account_name, variable_name, subscription_id | Retrieve the variable identified by variable name. | |
list_by_automation_account | select | resource_group_name, automation_account_name, subscription_id | Retrieve a list of variables. | |
create_or_update | insert | resource_group_name, automation_account_name, variable_name, subscription_id, name, properties | Create a variable. | |
update | update | resource_group_name, automation_account_name, variable_name, subscription_id | Update a variable. | |
create_or_update | replace | resource_group_name, automation_account_name, variable_name, subscription_id, name, properties | Create a variable. | |
delete | delete | resource_group_name, automation_account_name, variable_name, subscription_id | Delete 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.
| Name | Datatype | Description |
|---|---|---|
automation_account_name | string | The name of the automation account. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
variable_name | string | The name of variable. Required. |
SELECT examples
- get
- list_by_automation_account
Retrieve the variable identified by variable name.
SELECT
id,
name,
creationTime,
description,
isEncrypted,
lastModifiedTime,
systemData,
type,
value
FROM azure.automation.variable
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND variable_name = '{{ variable_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Retrieve a list of variables.
SELECT
id,
name,
creationTime,
description,
isEncrypted,
lastModifiedTime,
systemData,
type,
value
FROM azure.automation.variable
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create a variable.
INSERT INTO azure.automation.variable (
name,
properties,
resource_group_name,
automation_account_name,
variable_name,
subscription_id
)
SELECT
'{{ name }}' /* required */,
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ automation_account_name }}',
'{{ variable_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: variable
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the variable resource.
- name: automation_account_name
value: "{{ automation_account_name }}"
description: Required parameter for the variable resource.
- name: variable_name
value: "{{ variable_name }}"
description: Required parameter for the variable resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the variable resource.
- name: name
value: "{{ name }}"
description: |
Gets or sets the name of the variable. Required.
- name: properties
description: |
Gets or sets the properties of the variable. Required.
value:
value: "{{ value }}"
description: "{{ description }}"
isEncrypted: {{ isEncrypted }}
UPDATE examples
- update
Update a variable.
UPDATE azure.automation.variable
SET
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND variable_name = '{{ variable_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
REPLACE examples
- create_or_update
Create a variable.
REPLACE azure.automation.variable
SET
name = '{{ name }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND variable_name = '{{ variable_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND name = '{{ name }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Delete the variable.
DELETE FROM azure.automation.variable
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND variable_name = '{{ variable_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;