Job Executions - Create Or Update

Creates or updates a job execution.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}?api-version=2021-11-01

URI Parameters

Name In Required Type Description
jobAgentName
path True

string

The name of the job agent.

jobExecutionId
path True

string

uuid

The job execution id to create the job execution under.

jobName
path True

string

The name of the job to get.

resourceGroupName
path True

string

The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

Responses

Name Type Description
200 OK

JobExecution

A job execution for the job with the given id already existed.

201 Created

JobExecution

Successfully started an execution for the job.

202 Accepted

Accepted

Other Status Codes

*** Error Responses: ***

  • 400 ElasticJobsOperationFailed - Elastic jobs management operation failed.

  • 400 ElasticJobsOperationFailed - Elastic jobs management operation failed.

  • 404 JobAgentNotFound - Specified job agent does not exist in the specified logical server.

  • 404 ResourceNotFound - The requested resource was not found.

  • 404 SubscriptionDoesNotHaveServer - The requested server was not found

  • 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.

  • 404 OperationIdNotFound - The operation with Id does not exist.

  • 409 OperationCancelled - The operation has been cancelled by user.

  • 409 OperationInterrupted - The operation on the resource could not be completed because it was interrupted by another operation on the same resource.

  • 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.

  • 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.

  • 500 OperationTimedOut - The operation timed out and automatically rolled back. Please retry the operation.

  • 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.

Examples

Create job execution.

Sample request

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5A86BF65-43AC-F258-2524-9E92992F97CA?api-version=2021-11-01

Sample response

{
  "properties": {
    "jobVersion": 1,
    "jobExecutionId": "5A86BF65-43AC-F258-2524-9E92992F97CA",
    "lifecycle": "Created",
    "provisioningState": "Created",
    "createTime": "2017-12-18T19:02:00.8707045Z",
    "currentAttempts": 0,
    "lastMessage": "Job execution created."
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999",
  "name": "5555-6666-7777-8888-999999999999",
  "type": "Microsoft.Sql/servers/jobAgents/executions"
}
{
  "properties": {
    "jobVersion": 1,
    "jobExecutionId": "5A86BF65-43AC-F258-2524-9E92992F97CA",
    "lifecycle": "Created",
    "provisioningState": "Created",
    "createTime": "2017-05-04T19:02:00.8707045Z",
    "currentAttempts": 0,
    "lastMessage": "Job execution created."
  },
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/executions/5555-6666-7777-8888-999999999999",
  "name": "5555-6666-7777-8888-999999999999",
  "type": "Microsoft.Sql/servers/jobAgents/executions"
}

Definitions

Name Description
JobExecution

An execution of a job

JobExecutionLifecycle

The detailed state of the job execution.

JobExecutionTarget

The target that a job execution is executed on.

JobTargetType

The type of the target.

ProvisioningState

The ARM provisioning state of the job execution.

JobExecution

An execution of a job

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.createTime

string

The time that the job execution was created.

properties.currentAttemptStartTime

string

Start time of the current attempt.

properties.currentAttempts

integer

Number of times the job execution has been attempted.

properties.endTime

string

The time that the job execution completed.

properties.jobExecutionId

string

The unique identifier of the job execution.

properties.jobVersion

integer

The job version number.

properties.lastMessage

string

The last status or error message.

properties.lifecycle

JobExecutionLifecycle

The detailed state of the job execution.

properties.provisioningState

ProvisioningState

The ARM provisioning state of the job execution.

properties.startTime

string

The time that the job execution started.

properties.stepId

integer

The job step id.

properties.stepName

string

The job step name.

properties.target

JobExecutionTarget

The target that this execution is executed on.

type

string

Resource type.

JobExecutionLifecycle

The detailed state of the job execution.

Name Type Description
Canceled

string

Created

string

Failed

string

InProgress

string

Skipped

string

Succeeded

string

SucceededWithSkipped

string

TimedOut

string

WaitingForChildJobExecutions

string

WaitingForRetry

string

JobExecutionTarget

The target that a job execution is executed on.

Name Type Description
databaseName

string

The database name.

serverName

string

The server name.

type

JobTargetType

The type of the target.

JobTargetType

The type of the target.

Name Type Description
SqlDatabase

string

SqlElasticPool

string

SqlServer

string

SqlShardMap

string

TargetGroup

string

ProvisioningState

The ARM provisioning state of the job execution.

Name Type Description
Canceled

string

Created

string

Failed

string

InProgress

string

Succeeded

string