Job Steps - Get

Gets a job step in a job's current version.

GET 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
jobAgentName
path True

string

The name of the job agent.

jobName
path True

string

The name of the job.

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.

stepName
path True

string

The name of the job step.

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

JobStep

Successfully retrieved the job step.

Other Status Codes

*** Error Responses: ***

  • 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.

Examples

Get the latest version of a job step.

Sample Request

GET 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

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"
}

Definitions

Name Description
JobStep

A job step.

JobStepAction

The action to be executed by a job step.

JobStepActionSource

The source of the action to execute.

JobStepActionType

Type of action being executed by the job step.

JobStepExecutionOptions

The execution options of a job step.

JobStepOutput

The output configuration of a job step.

JobStepOutputType

The output destination type.

JobStep

A job step.

Name Type Description
id

string

Resource ID.

name

string

Resource name.

properties.action

JobStepAction

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

JobStepExecutionOptions

Execution options for the job step.

properties.output

JobStepOutput

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

JobStepActionSource

Inline

The source of the action to execute.

type

JobStepActionType

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

JobStepOutputType

SqlDatabase

The output destination type.

JobStepOutputType

The output destination type.

Name Type Description
SqlDatabase

string