Share via


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=2025-01-01

URI Parameters

Name In Required Type Description
jobAgentName
path True

string

The name of the job agent.

jobExecutionId
path True

string (uuid)

The id of the job execution

jobName
path True

string

The name of the job.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

serverName
path True

string

The name of the server.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

JobExecution

Resource 'JobExecution' update operation succeeded

201 Created

JobExecution

Resource 'JobExecution' create operation succeeded

Headers

  • Location: string
  • Retry-After: integer
202 Accepted

Resource operation accepted.

Headers

  • Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

An unexpected error response.

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 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=2025-01-01

Sample response

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

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

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.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

JobExecution

An execution of a job

Name Type Description
id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

name

string

The name of the resource

properties.createTime

string (date-time)

The time that the job execution was created.

properties.currentAttemptStartTime

string (date-time)

Start time of the current attempt.

properties.currentAttempts

integer (int32)

Number of times the job execution has been attempted.

properties.endTime

string (date-time)

The time that the job execution completed.

properties.jobExecutionId

string (uuid)

The unique identifier of the job execution.

properties.jobVersion

integer (int32)

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 (date-time)

The time that the job execution started.

properties.stepId

integer (int32)

The job step id.

properties.stepName

string

The job step name.

properties.target

JobExecutionTarget

The target that this execution is executed on.

systemData

systemData

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"

JobExecutionLifecycle

The detailed state of the job execution.

Value Description
Created

Created

InProgress

InProgress

WaitingForChildJobExecutions

WaitingForChildJobExecutions

WaitingForRetry

WaitingForRetry

Succeeded

Succeeded

SucceededWithSkipped

SucceededWithSkipped

Failed

Failed

TimedOut

TimedOut

Canceled

Canceled

Skipped

Skipped

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.

Value Description
TargetGroup

TargetGroup

SqlDatabase

SqlDatabase

SqlElasticPool

SqlElasticPool

SqlShardMap

SqlShardMap

SqlServer

SqlServer

ProvisioningState

The ARM provisioning state of the job execution.

Value Description
Created

Created

InProgress

InProgress

Succeeded

Succeeded

Failed

Failed

Canceled

Canceled

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.