runbook
Creates, updates, deletes, gets or lists a runbook resource.
Overview
| Name | runbook |
| Type | Resource |
| Id | azure.automation.runbook |
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. |
draft | object | Gets or sets the draft runbook properties. |
etag | string | Gets or sets the etag of the resource. |
jobCount | integer | Gets or sets the job count of the runbook. |
lastModifiedBy | string | Gets or sets the last modified by. |
lastModifiedTime | string (date-time) | Gets or sets the last modified time. |
location | string | The geo-location where the resource lives. Required. |
logActivityTrace | integer | Gets or sets the option to log activity trace of the runbook. |
logProgress | boolean | Gets or sets progress log option. |
logVerbose | boolean | Gets or sets verbose log option. |
outputTypes | array | Gets or sets the runbook output types. |
parameters | object | Gets or sets the runbook parameters. |
provisioningState | string | Gets or sets the provisioning state of the runbook. Default value is "Succeeded". |
publishContentLink | object | Gets or sets the published runbook content link. |
runbookType | string | Gets or sets the type of the runbook. Known values are: "Script", "Graph", "PowerShellWorkflow", "PowerShell", "GraphPowerShellWorkflow", "GraphPowerShell", "Python2", "Python3", "Python", and "PowerShell72". (Script, Graph, PowerShellWorkflow, PowerShell, GraphPowerShellWorkflow, GraphPowerShell, Python2, Python3, Python, PowerShell72) |
runtimeEnvironment | string | Runtime Environment of the runbook execution. |
state | string | Gets or sets the state of the runbook. Known values are: "New", "Edit", and "Published". (New, Edit, Published) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
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. |
creationTime | string (date-time) | Gets or sets the creation time. |
description | string | Gets or sets the description. |
draft | object | Gets or sets the draft runbook properties. |
etag | string | Gets or sets the etag of the resource. |
jobCount | integer | Gets or sets the job count of the runbook. |
lastModifiedBy | string | Gets or sets the last modified by. |
lastModifiedTime | string (date-time) | Gets or sets the last modified time. |
location | string | The geo-location where the resource lives. Required. |
logActivityTrace | integer | Gets or sets the option to log activity trace of the runbook. |
logProgress | boolean | Gets or sets progress log option. |
logVerbose | boolean | Gets or sets verbose log option. |
outputTypes | array | Gets or sets the runbook output types. |
parameters | object | Gets or sets the runbook parameters. |
provisioningState | string | Gets or sets the provisioning state of the runbook. Default value is "Succeeded". |
publishContentLink | object | Gets or sets the published runbook content link. |
runbookType | string | Gets or sets the type of the runbook. Known values are: "Script", "Graph", "PowerShellWorkflow", "PowerShell", "GraphPowerShellWorkflow", "GraphPowerShell", "Python2", "Python3", "Python", and "PowerShell72". (Script, Graph, PowerShellWorkflow, PowerShell, GraphPowerShellWorkflow, GraphPowerShell, Python2, Python3, Python, PowerShell72) |
runtimeEnvironment | string | Runtime Environment of the runbook execution. |
state | string | Gets or sets the state of the runbook. Known values are: "New", "Edit", and "Published". (New, Edit, Published) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
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:
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. |
runbook_name | string | The runbook name. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_automation_account
Retrieve the runbook identified by runbook name.
SELECT
id,
name,
creationTime,
description,
draft,
etag,
jobCount,
lastModifiedBy,
lastModifiedTime,
location,
logActivityTrace,
logProgress,
logVerbose,
outputTypes,
parameters,
provisioningState,
publishContentLink,
runbookType,
runtimeEnvironment,
state,
systemData,
tags,
type
FROM azure.automation.runbook
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND runbook_name = '{{ runbook_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Retrieve a list of runbooks.
SELECT
id,
name,
creationTime,
description,
draft,
etag,
jobCount,
lastModifiedBy,
lastModifiedTime,
location,
logActivityTrace,
logProgress,
logVerbose,
outputTypes,
parameters,
provisioningState,
publishContentLink,
runbookType,
runtimeEnvironment,
state,
systemData,
tags,
type
FROM azure.automation.runbook
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 the runbook identified by runbook name.
INSERT INTO azure.automation.runbook (
properties,
name,
location,
tags,
resource_group_name,
automation_account_name,
runbook_name,
subscription_id
)
SELECT
'{{ properties }}' /* required */,
'{{ name }}',
'{{ location }}',
'{{ tags }}',
'{{ resource_group_name }}',
'{{ automation_account_name }}',
'{{ runbook_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
etag,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: runbook
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the runbook resource.
- name: automation_account_name
value: "{{ automation_account_name }}"
description: Required parameter for the runbook resource.
- name: runbook_name
value: "{{ runbook_name }}"
description: Required parameter for the runbook resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the runbook resource.
- name: properties
description: |
Gets or sets runbook create or update properties. Required.
value:
logVerbose: {{ logVerbose }}
logProgress: {{ logProgress }}
runtimeEnvironment: "{{ runtimeEnvironment }}"
runbookType: "{{ runbookType }}"
draft:
inEdit: {{ inEdit }}
draftContentLink:
uri: "{{ uri }}"
contentHash:
algorithm: "{{ algorithm }}"
value: "{{ value }}"
version: "{{ version }}"
creationTime: "{{ creationTime }}"
lastModifiedTime: "{{ lastModifiedTime }}"
parameters: "{{ parameters }}"
outputTypes:
- "{{ outputTypes }}"
publishContentLink:
uri: "{{ uri }}"
contentHash:
algorithm: "{{ algorithm }}"
value: "{{ value }}"
version: "{{ version }}"
description: "{{ description }}"
logActivityTrace: {{ logActivityTrace }}
- name: name
value: "{{ name }}"
description: |
Gets or sets the name of the resource.
- name: location
value: "{{ location }}"
description: |
Gets or sets the location of the resource.
- name: tags
value: "{{ tags }}"
description: |
Gets or sets the tags attached to the resource.
UPDATE examples
- update
Update the runbook identified by runbook name.
UPDATE azure.automation.runbook
SET
properties = '{{ properties }}',
name = '{{ name }}',
location = '{{ location }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND runbook_name = '{{ runbook_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
etag,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Create the runbook identified by runbook name.
REPLACE azure.automation.runbook
SET
properties = '{{ properties }}',
name = '{{ name }}',
location = '{{ location }}',
tags = '{{ tags }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND runbook_name = '{{ runbook_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
etag,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Delete the runbook by name.
DELETE FROM azure.automation.runbook
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND automation_account_name = '{{ automation_account_name }}' --required
AND runbook_name = '{{ runbook_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- get_content
- publish
Retrieve the content of runbook identified by runbook name.
EXEC azure.automation.runbook.get_content
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@runbook_name='{{ runbook_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Publish runbook draft.
EXEC azure.automation.runbook.publish
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@runbook_name='{{ runbook_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;