job
Creates, updates, deletes, gets or lists a job resource.
Overview
| Name | job |
| Type | Resource |
| Id | azure.automation.job |
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 of the job. |
endTime | string (date-time) | Gets or sets the end time of the job. |
exception | string | Gets or sets the exception of the job. |
jobId | string | Gets or sets the id of the job. |
jobRuntimeEnvironment | object | Runtime Environment Property. |
lastModifiedTime | string (date-time) | Gets or sets the last modified time of the job. |
lastStatusModifiedTime | string (date-time) | Gets or sets the last status modified time of the job. |
parameters | object | Gets or sets the parameters of the job. |
provisioningState | string | The current provisioning state of the job. Known values are: "Failed", "Succeeded", "Suspended", and "Processing". (Failed, Succeeded, Suspended, Processing) |
runOn | string | Gets or sets the runOn which specifies the group name where the job is to be executed. |
runbook | object | Gets or sets the runbook. |
startTime | string (date-time) | Gets or sets the start time of the job. |
startedBy | string | Gets or sets the job started by. |
status | string | Gets or sets the status of the job. Known values are: "New", "Activating", "Running", "Completed", "Failed", "Stopped", "Blocked", "Suspended", "Disconnected", "Suspending", "Stopping", "Resuming", and "Removing". (New, Activating, Running, Completed, Failed, Stopped, Blocked, Suspended, Disconnected, Suspending, Stopping, Resuming, Removing) |
statusDetails | string | Gets or sets the status details of the job. |
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. |
creationTime | string (date-time) | The creation time of the job. |
endTime | string (date-time) | The end time of the job. |
jobId | string | The id of the job. |
jobRuntimeEnvironment | object | Runtime Environment Property. |
lastModifiedTime | string (date-time) | The last modified time of the job. |
provisioningState | string | The provisioning state of a resource. |
runOn | string | Specifies the runOn group name where the job was executed. |
runbook | object | The runbook association. |
startTime | string (date-time) | The start time of the job. |
startedBy | string | Gets or sets the job started by. |
status | string | The status of the job. Known values are: "New", "Activating", "Running", "Completed", "Failed", "Stopped", "Blocked", "Suspended", "Disconnected", "Suspending", "Stopping", "Resuming", and "Removing". (New, Activating, Running, Completed, Failed, Stopped, Blocked, Suspended, Disconnected, Suspending, Stopping, Resuming, Removing) |
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:
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. |
job_name | string | The job name. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string | |
$filter | string | The filter to apply on the operation. Default value is None. |
clientRequestId | string | Identifies this specific client request. Default value is None. |
SELECT examples
- get
- list_by_automation_account
Retrieve the job identified by job name.
SELECT
id,
name,
creationTime,
endTime,
exception,
jobId,
jobRuntimeEnvironment,
lastModifiedTime,
lastStatusModifiedTime,
parameters,
provisioningState,
runOn,
runbook,
startTime,
startedBy,
status,
statusDetails,
systemData,
type
FROM azure.automation.job
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND job_name = '{{ job_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND clientRequestId = '{{ clientRequestId }}'
;
Retrieve a list of jobs.
SELECT
id,
name,
creationTime,
endTime,
jobId,
jobRuntimeEnvironment,
lastModifiedTime,
provisioningState,
runOn,
runbook,
startTime,
startedBy,
status,
systemData,
type
FROM azure.automation.job
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND automation_account_name = '{{ automation_account_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND $filter = '{{ $filter }}'
AND clientRequestId = '{{ clientRequestId }}'
;
INSERT examples
- create
- Manifest
Create a job of the runbook.
INSERT INTO azure.automation.job (
properties,
resource_group_name,
automation_account_name,
job_name,
subscription_id,
clientRequestId
)
SELECT
'{{ properties }}' /* required */,
'{{ resource_group_name }}',
'{{ automation_account_name }}',
'{{ job_name }}',
'{{ subscription_id }}',
'{{ clientRequestId }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: job
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the job resource.
- name: automation_account_name
value: "{{ automation_account_name }}"
description: Required parameter for the job resource.
- name: job_name
value: "{{ job_name }}"
description: Required parameter for the job resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the job resource.
- name: properties
description: |
Gets or sets the list of job properties. Required.
value:
runbook:
name: "{{ name }}"
parameters: "{{ parameters }}"
runOn: "{{ runOn }}"
- name: clientRequestId
value: "{{ clientRequestId }}"
description: Identifies this specific client request. Default value is None.
description: Identifies this specific client request. Default value is None.
Lifecycle Methods
- get_output
- get_runbook_content
- suspend
- stop
- resume
Retrieve the job output identified by job name.
EXEC azure.automation.job.get_output
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@job_name='{{ job_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@clientRequestId='{{ clientRequestId }}'
;
Retrieve the runbook content of the job identified by job name.
EXEC azure.automation.job.get_runbook_content
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@job_name='{{ job_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@clientRequestId='{{ clientRequestId }}'
;
Suspend the job identified by job name.
EXEC azure.automation.job.suspend
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@job_name='{{ job_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@clientRequestId='{{ clientRequestId }}'
;
Stop the job identified by jobName.
EXEC azure.automation.job.stop
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@job_name='{{ job_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@clientRequestId='{{ clientRequestId }}'
;
Resume the job identified by jobName.
EXEC azure.automation.job.resume
@resource_group_name='{{ resource_group_name }}' --required,
@automation_account_name='{{ automation_account_name }}' --required,
@job_name='{{ job_name }}' --required,
@subscription_id='{{ subscription_id }}' --required,
@clientRequestId='{{ clientRequestId }}'
;