Skip to main content

runbooks

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

Overview

Namerunbooks
TypeResource
Idazure.automation.runbooks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
etagstringGets or sets the etag of the resource.
locationstringThe Azure Region where the resource lives
propertiesobjectGets or sets the runbook properties.
tagsobjectResource tags.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, automationAccountName, runbookNameRetrieve the runbook identified by runbook name.
list_by_automation_accountselectsubscriptionId, resourceGroupName, automationAccountNameRetrieve a list of runbooks.
create_or_updateinsertsubscriptionId, resourceGroupName, automationAccountName, runbookName, data__propertiesCreate the runbook identified by runbook name.
updateupdatesubscriptionId, resourceGroupName, automationAccountName, runbookNameUpdate the runbook identified by runbook name.
deletedeletesubscriptionId, resourceGroupName, automationAccountName, runbookNameDelete the runbook by name.
publishexecsubscriptionId, resourceGroupName, automationAccountName, runbookNamePublish runbook draft.

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.
runbookNamestringThe parameters supplied to the publish runbook operation.
subscriptionIdstringGets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

SELECT examples

Retrieve the runbook identified by runbook name.

SELECT
etag,
location,
properties,
tags
FROM azure.automation.runbooks
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND automationAccountName = '{{ automationAccountName }}' -- required
AND runbookName = '{{ runbookName }}' -- required
;

INSERT examples

Create the runbook identified by runbook name.

INSERT INTO azure.automation.runbooks (
data__properties,
data__name,
data__location,
data__tags,
subscriptionId,
resourceGroupName,
automationAccountName,
runbookName
)
SELECT
'{{ properties }}' /* required */,
'{{ name }}',
'{{ location }}',
'{{ tags }}',
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ automationAccountName }}',
'{{ runbookName }}'
RETURNING
etag,
location,
properties,
tags
;

UPDATE examples

Update the runbook identified by runbook name.

UPDATE azure.automation.runbooks
SET
data__properties = '{{ properties }}',
data__name = '{{ name }}',
data__location = '{{ location }}',
data__tags = '{{ tags }}'
WHERE
subscriptionId = '{{ subscriptionId }}' --required
AND resourceGroupName = '{{ resourceGroupName }}' --required
AND automationAccountName = '{{ automationAccountName }}' --required
AND runbookName = '{{ runbookName }}' --required
RETURNING
etag,
location,
properties,
tags;

DELETE examples

Delete the runbook by name.

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

Lifecycle Methods

Publish runbook draft.

EXEC azure.automation.runbooks.publish 
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@automationAccountName='{{ automationAccountName }}' --required,
@runbookName='{{ runbookName }}' --required
;