Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idazure.automation.jobs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
propertiesobjectThe properties of the job.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectsubscriptionId, resourceGroupName, automationAccountName, jobNameclientRequestIdRetrieve the job identified by job name.
list_by_automation_accountselectresourceGroupName, automationAccountName, subscriptionId$filter, clientRequestIdRetrieve a list of jobs.
createinsertsubscriptionId, resourceGroupName, automationAccountName, jobName, data__propertiesclientRequestIdCreate a job of the runbook.
suspendexecsubscriptionId, resourceGroupName, automationAccountName, jobNameclientRequestIdSuspend the job identified by job name.
stopexecresourceGroupName, automationAccountName, jobName, subscriptionIdclientRequestIdStop the job identified by jobName.
resumeexecresourceGroupName, automationAccountName, jobName, subscriptionIdclientRequestIdResume the job identified by jobName.

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.
jobNamestringThe job name.
resourceGroupNamestringName of an Azure Resource group.
subscriptionIdstringGets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
$filterstringThe filter to apply on the operation.
clientRequestIdstringIdentifies this specific client request.

SELECT examples

Retrieve the job identified by job name.

SELECT
properties
FROM azure.automation.jobs
WHERE subscriptionId = '{{ subscriptionId }}' -- required
AND resourceGroupName = '{{ resourceGroupName }}' -- required
AND automationAccountName = '{{ automationAccountName }}' -- required
AND jobName = '{{ jobName }}' -- required
AND clientRequestId = '{{ clientRequestId }}'
;

INSERT examples

Create a job of the runbook.

INSERT INTO azure.automation.jobs (
data__properties,
subscriptionId,
resourceGroupName,
automationAccountName,
jobName,
clientRequestId
)
SELECT
'{{ properties }}' /* required */,
'{{ subscriptionId }}',
'{{ resourceGroupName }}',
'{{ automationAccountName }}',
'{{ jobName }}',
'{{ clientRequestId }}'
RETURNING
properties
;

Lifecycle Methods

Suspend the job identified by job name.

EXEC azure.automation.jobs.suspend 
@subscriptionId='{{ subscriptionId }}' --required,
@resourceGroupName='{{ resourceGroupName }}' --required,
@automationAccountName='{{ automationAccountName }}' --required,
@jobName='{{ jobName }}' --required,
@clientRequestId='{{ clientRequestId }}'
;