Job Steps - Create Or Update
Creates or updates a job step. This will implicitly create a new job version.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}?api-version=2021-11-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
job
|
path | True |
string |
The name of the job agent. |
job
|
path | True |
string |
The name of the job. |
resource
|
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. |
server
|
path | True |
string |
The name of the server. |
step
|
path | True |
string |
The name of the job step. |
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
api-version
|
query | True |
string |
The API version to use for the request. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
properties.action | True |
The action payload of the job step. |
|
properties.credential | True |
string |
The resource ID of the job credential that will be used to connect to the targets. |
properties.targetGroup | True |
string |
The resource ID of the target group that the job step will be executed on. |
properties.executionOptions |
Execution options for the job step. |
||
properties.output |
Output destination properties of the job step. |
||
properties.stepId |
integer |
The job step's index within the job. If not specified when creating the job step, it will be created as the last step. If not specified when updating the job step, the step id is not modified. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Successfully updated the job step. |
|
201 Created |
Successfully added the job step. |
|
Other Status Codes |
*** Error Responses: ***
|
Examples
Create or update a job step with all properties specified. |
Create or update a job step with minimal properties specified. |
Create or update a job step with all properties specified.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1?api-version=2021-11-01
{
"properties": {
"stepId": 1,
"targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
"action": {
"type": "TSql",
"source": "Inline",
"value": "select 2"
},
"output": {
"type": "SqlDatabase",
"subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a",
"resourceGroupName": "group3",
"serverName": "server3",
"databaseName": "database3",
"schemaName": "myschema1234",
"tableName": "mytable5678",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"
},
"executionOptions": {
"timeoutSeconds": 1234,
"retryAttempts": 42,
"initialRetryIntervalSeconds": 11,
"maximumRetryIntervalSeconds": 222,
"retryIntervalBackoffMultiplier": 3
}
}
}
Sample response
{
"properties": {
"stepId": 1,
"targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
"action": {
"type": "TSql",
"source": "Inline",
"value": "select 2"
},
"output": {
"type": "SqlDatabase",
"subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a",
"resourceGroupName": "group3",
"serverName": "server3",
"databaseName": "database3",
"schemaName": "myschema1234",
"tableName": "mytable5678",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"
},
"executionOptions": {
"timeoutSeconds": 1234,
"retryAttempts": 42,
"initialRetryIntervalSeconds": 11,
"maximumRetryIntervalSeconds": 222,
"retryIntervalBackoffMultiplier": 3
}
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
"name": "step1",
"type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}
{
"properties": {
"stepId": 1,
"targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
"action": {
"type": "TSql",
"source": "Inline",
"value": "select 2"
},
"output": {
"type": "SqlDatabase",
"subscriptionId": "3501b905-a848-4b5d-96e8-b253f62d735a",
"resourceGroupName": "group3",
"serverName": "server3",
"databaseName": "database3",
"schemaName": "myschema1234",
"tableName": "mytable5678",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"
},
"executionOptions": {
"timeoutSeconds": 1234,
"retryAttempts": 42,
"initialRetryIntervalSeconds": 11,
"maximumRetryIntervalSeconds": 222,
"retryIntervalBackoffMultiplier": 3
}
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
"name": "step1",
"type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}
Create or update a job step with minimal properties specified.
Sample request
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1?api-version=2021-11-01
{
"properties": {
"targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
"action": {
"value": "select 1"
}
}
}
Sample response
{
"properties": {
"stepId": 1,
"targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
"action": {
"type": "TSql",
"source": "Inline",
"value": "select 1"
},
"executionOptions": {
"timeoutSeconds": 43200,
"retryAttempts": 10,
"initialRetryIntervalSeconds": 1,
"maximumRetryIntervalSeconds": 120,
"retryIntervalBackoffMultiplier": 2
}
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
"name": "step1",
"type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}
{
"properties": {
"stepId": 1,
"targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
"credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
"action": {
"type": "TSql",
"source": "Inline",
"value": "select 1"
},
"executionOptions": {
"timeoutSeconds": 43200,
"retryAttempts": 10,
"initialRetryIntervalSeconds": 1,
"maximumRetryIntervalSeconds": 120,
"retryIntervalBackoffMultiplier": 2
}
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/jobs/job1/steps/step1",
"name": "step1",
"type": "Microsoft.Sql/servers/jobAgents/jobs/steps"
}
Definitions
Name | Description |
---|---|
Job |
A job step. |
Job |
The action to be executed by a job step. |
Job |
The source of the action to execute. |
Job |
Type of action being executed by the job step. |
Job |
The execution options of a job step. |
Job |
The output configuration of a job step. |
Job |
The output destination type. |
JobStep
A job step.
Name | Type | Description |
---|---|---|
id |
string |
Resource ID. |
name |
string |
Resource name. |
properties.action |
The action payload of the job step. |
|
properties.credential |
string |
The resource ID of the job credential that will be used to connect to the targets. |
properties.executionOptions |
Execution options for the job step. |
|
properties.output |
Output destination properties of the job step. |
|
properties.stepId |
integer |
The job step's index within the job. If not specified when creating the job step, it will be created as the last step. If not specified when updating the job step, the step id is not modified. |
properties.targetGroup |
string |
The resource ID of the target group that the job step will be executed on. |
type |
string |
Resource type. |
JobStepAction
The action to be executed by a job step.
Name | Type | Default value | Description |
---|---|---|---|
source | Inline |
The source of the action to execute. |
|
type | TSql |
Type of action being executed by the job step. |
|
value |
string |
The action value, for example the text of the T-SQL script to execute. |
JobStepActionSource
The source of the action to execute.
Name | Type | Description |
---|---|---|
Inline |
string |
JobStepActionType
Type of action being executed by the job step.
Name | Type | Description |
---|---|---|
TSql |
string |
JobStepExecutionOptions
The execution options of a job step.
Name | Type | Default value | Description |
---|---|---|---|
initialRetryIntervalSeconds |
integer |
1 |
Initial delay between retries for job step execution. |
maximumRetryIntervalSeconds |
integer |
120 |
The maximum amount of time to wait between retries for job step execution. |
retryAttempts |
integer |
10 |
Maximum number of times the job step will be reattempted if the first attempt fails. |
retryIntervalBackoffMultiplier |
number |
2 |
The backoff multiplier for the time between retries. |
timeoutSeconds |
integer |
43200 |
Execution timeout for the job step. |
JobStepOutput
The output configuration of a job step.
Name | Type | Default value | Description |
---|---|---|---|
credential |
string |
The resource ID of the credential to use to connect to the output destination. |
|
databaseName |
string |
The output destination database. |
|
resourceGroupName |
string |
The output destination resource group. |
|
schemaName |
string |
dbo |
The output destination schema. |
serverName |
string |
The output destination server name. |
|
subscriptionId |
string |
The output destination subscription id. |
|
tableName |
string |
The output destination table. |
|
type | SqlDatabase |
The output destination type. |
JobStepOutputType
The output destination type.
Name | Type | Description |
---|---|---|
SqlDatabase |
string |