Job - Create

Create a job of the runbook.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}?api-version=2023-11-01

URI Parameters

Name In Required Type Description
automationAccountName
path True

string

The name of the automation account.

jobName
path True

string

The job name.

resourceGroupName
path True

string

Name of an Azure Resource group.

Regex pattern: ^[-\w\._]+$

subscriptionId
path True

string

Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Client Api Version.

Request Header

Name Required Type Description
clientRequestId

string

Identifies this specific client request.

Request Body

Name Type Description
properties.parameters

object

Gets or sets the parameters of the job.

properties.runOn

string

Gets or sets the runOn which specifies the group name where the job is to be executed.

properties.runbook

RunbookAssociationProperty

Gets or sets the runbook.

Responses

Name Type Description
201 Created

Job

Created

Other Status Codes

ErrorResponse

Automation error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Create job

Sample request

PUT https://management.azure.com/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/jobs/foo?api-version=2023-11-01

{
  "properties": {
    "runbook": {
      "name": "TestRunbook"
    },
    "parameters": {
      "key01": "value01",
      "key02": "value02"
    },
    "runOn": ""
  }
}

Sample response

{
  "id": "/subscriptions/51766542-3ed7-4a72-a187-0c8ab644ddab/resourceGroups/mygroup/providers/Microsoft.Automation/automationAccounts/ContoseAutomationAccount/jobs/jobName",
  "name": "foo",
  "type": "Microsoft.Automation/AutomationAccounts/Jobs",
  "properties": {
    "jobId": "5b8a3960-e8ab-45f6-bec6-567df8467d1a",
    "runbook": {
      "name": "TestRunbook"
    },
    "provisioningState": "Processing",
    "creationTime": "2018-02-01T05:53:30.243+00:00",
    "endTime": null,
    "exception": null,
    "lastModifiedTime": "2018-02-01T05:53:30.243+00:00",
    "lastStatusModifiedTime": "2018-02-01T05:53:30.243+00:00",
    "startTime": null,
    "status": "New",
    "statusDetails": "None",
    "parameters": {
      "tag01": "value01",
      "tag02": "value02"
    },
    "runOn": ""
  }
}

Definitions

Name Description
ErrorResponse

Error response of an operation failure

Job

Definition of the job.

JobCreateParameters

The parameters supplied to the create job operation.

JobProvisioningState

The current provisioning state of the job.

JobStatus

Gets or sets the status of the job.

RunbookAssociationProperty

The runbook property associated with the entity.

ErrorResponse

Error response of an operation failure

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

Job

Definition of the job.

Name Type Description
id

string

Fully qualified resource Id for the resource

name

string

The name of the resource

properties.creationTime

string

Gets or sets the creation time of the job.

properties.endTime

string

Gets or sets the end time of the job.

properties.exception

string

Gets or sets the exception of the job.

properties.jobId

string

Gets or sets the id of the job.

properties.lastModifiedTime

string

Gets or sets the last modified time of the job.

properties.lastStatusModifiedTime

string

Gets or sets the last status modified time of the job.

properties.parameters

object

Gets or sets the parameters of the job.

properties.provisioningState

JobProvisioningState

The current provisioning state of the job.

properties.runOn

string

Gets or sets the runOn which specifies the group name where the job is to be executed.

properties.runbook

RunbookAssociationProperty

Gets or sets the runbook.

properties.startTime

string

Gets or sets the start time of the job.

properties.startedBy

string

Gets or sets the job started by.

properties.status

JobStatus

Gets or sets the status of the job.

properties.statusDetails

string

Gets or sets the status details of the job.

type

string

The type of the resource.

JobCreateParameters

The parameters supplied to the create job operation.

Name Type Description
properties.parameters

object

Gets or sets the parameters of the job.

properties.runOn

string

Gets or sets the runOn which specifies the group name where the job is to be executed.

properties.runbook

RunbookAssociationProperty

Gets or sets the runbook.

JobProvisioningState

The current provisioning state of the job.

Name Type Description
Failed

string

Processing

string

Succeeded

string

Suspended

string

JobStatus

Gets or sets the status of the job.

Name Type Description
Activating

string

Blocked

string

Completed

string

Disconnected

string

Failed

string

New

string

Removing

string

Resuming

string

Running

string

Stopped

string

Stopping

string

Suspended

string

Suspending

string

RunbookAssociationProperty

The runbook property associated with the entity.

Name Type Description
name

string

Gets or sets the name of the runbook.