1. Packages
  2. Azure Classic
  3. API Docs
  4. mssql
  5. JobStep

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.mssql.JobStep

Explore with Pulumi AI

Manages an Elastic Job Step.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.core.ResourceGroup("example", {
    name: "example",
    location: "westeurope",
});
const exampleServer = new azure.mssql.Server("example", {
    name: "example-server",
    location: example.location,
    resourceGroupName: example.name,
    version: "12.0",
    administratorLogin: "4dm1n157r470r",
    administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
});
const exampleDatabase = new azure.mssql.Database("example", {
    name: "example-db",
    serverId: exampleServer.id,
    collation: "SQL_Latin1_General_CP1_CI_AS",
    skuName: "S1",
});
const exampleJobAgent = new azure.mssql.JobAgent("example", {
    name: "example-job-agent",
    location: example.location,
    databaseId: exampleDatabase.id,
});
const exampleJobCredential = new azure.mssql.JobCredential("example", {
    name: "example-job-credential",
    jobAgentId: exampleJobAgent.id,
    username: "testusername",
    password: "testpassword",
});
const exampleJobTargetGroup = new azure.mssql.JobTargetGroup("example", {
    name: "example-target-group",
    jobAgentId: exampleJobAgent.id,
    jobTargets: [{
        serverName: exampleServer.name,
        databaseName: exampleDatabase.name,
        jobCredentialId: exampleJobCredential.id,
    }],
});
const exampleJob = new azure.mssql.Job("example", {
    name: "example-job",
    jobAgentId: exampleJobAgent.id,
    description: "example description",
});
const test = new azure.mssql.JobStep("test", {
    name: "example-job-step",
    jobId: exampleJob.id,
    jobCredentialId: exampleJobCredential.id,
    jobTargetGroupId: exampleJobTargetGroup.id,
    jobStepIndex: 1,
    sqlScript: `IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets')
  CREATE TABLE Pets (
    Animal NVARCHAR(50),
    Name NVARCHAR(50),
  );
`,
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.core.ResourceGroup("example",
    name="example",
    location="westeurope")
example_server = azure.mssql.Server("example",
    name="example-server",
    location=example.location,
    resource_group_name=example.name,
    version="12.0",
    administrator_login="4dm1n157r470r",
    administrator_login_password="4-v3ry-53cr37-p455w0rd")
example_database = azure.mssql.Database("example",
    name="example-db",
    server_id=example_server.id,
    collation="SQL_Latin1_General_CP1_CI_AS",
    sku_name="S1")
example_job_agent = azure.mssql.JobAgent("example",
    name="example-job-agent",
    location=example.location,
    database_id=example_database.id)
example_job_credential = azure.mssql.JobCredential("example",
    name="example-job-credential",
    job_agent_id=example_job_agent.id,
    username="testusername",
    password="testpassword")
example_job_target_group = azure.mssql.JobTargetGroup("example",
    name="example-target-group",
    job_agent_id=example_job_agent.id,
    job_targets=[{
        "server_name": example_server.name,
        "database_name": example_database.name,
        "job_credential_id": example_job_credential.id,
    }])
example_job = azure.mssql.Job("example",
    name="example-job",
    job_agent_id=example_job_agent.id,
    description="example description")
test = azure.mssql.JobStep("test",
    name="example-job-step",
    job_id=example_job.id,
    job_credential_id=example_job_credential.id,
    job_target_group_id=example_job_target_group.id,
    job_step_index=1,
    sql_script="""IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets')
  CREATE TABLE Pets (
    Animal NVARCHAR(50),
    Name NVARCHAR(50),
  );
""")
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/mssql"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example"),
			Location: pulumi.String("westeurope"),
		})
		if err != nil {
			return err
		}
		exampleServer, err := mssql.NewServer(ctx, "example", &mssql.ServerArgs{
			Name:                       pulumi.String("example-server"),
			Location:                   example.Location,
			ResourceGroupName:          example.Name,
			Version:                    pulumi.String("12.0"),
			AdministratorLogin:         pulumi.String("4dm1n157r470r"),
			AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"),
		})
		if err != nil {
			return err
		}
		exampleDatabase, err := mssql.NewDatabase(ctx, "example", &mssql.DatabaseArgs{
			Name:      pulumi.String("example-db"),
			ServerId:  exampleServer.ID(),
			Collation: pulumi.String("SQL_Latin1_General_CP1_CI_AS"),
			SkuName:   pulumi.String("S1"),
		})
		if err != nil {
			return err
		}
		exampleJobAgent, err := mssql.NewJobAgent(ctx, "example", &mssql.JobAgentArgs{
			Name:       pulumi.String("example-job-agent"),
			Location:   example.Location,
			DatabaseId: exampleDatabase.ID(),
		})
		if err != nil {
			return err
		}
		exampleJobCredential, err := mssql.NewJobCredential(ctx, "example", &mssql.JobCredentialArgs{
			Name:       pulumi.String("example-job-credential"),
			JobAgentId: exampleJobAgent.ID(),
			Username:   pulumi.String("testusername"),
			Password:   pulumi.String("testpassword"),
		})
		if err != nil {
			return err
		}
		exampleJobTargetGroup, err := mssql.NewJobTargetGroup(ctx, "example", &mssql.JobTargetGroupArgs{
			Name:       pulumi.String("example-target-group"),
			JobAgentId: exampleJobAgent.ID(),
			JobTargets: mssql.JobTargetGroupJobTargetArray{
				&mssql.JobTargetGroupJobTargetArgs{
					ServerName:      exampleServer.Name,
					DatabaseName:    exampleDatabase.Name,
					JobCredentialId: exampleJobCredential.ID(),
				},
			},
		})
		if err != nil {
			return err
		}
		exampleJob, err := mssql.NewJob(ctx, "example", &mssql.JobArgs{
			Name:        pulumi.String("example-job"),
			JobAgentId:  exampleJobAgent.ID(),
			Description: pulumi.String("example description"),
		})
		if err != nil {
			return err
		}
		_, err = mssql.NewJobStep(ctx, "test", &mssql.JobStepArgs{
			Name:             pulumi.String("example-job-step"),
			JobId:            exampleJob.ID(),
			JobCredentialId:  exampleJobCredential.ID(),
			JobTargetGroupId: exampleJobTargetGroup.ID(),
			JobStepIndex:     pulumi.Int(1),
			SqlScript: pulumi.String(`IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets')
  CREATE TABLE Pets (
    Animal NVARCHAR(50),
    Name NVARCHAR(50),
  );
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example",
        Location = "westeurope",
    });

    var exampleServer = new Azure.MSSql.Server("example", new()
    {
        Name = "example-server",
        Location = example.Location,
        ResourceGroupName = example.Name,
        Version = "12.0",
        AdministratorLogin = "4dm1n157r470r",
        AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
    });

    var exampleDatabase = new Azure.MSSql.Database("example", new()
    {
        Name = "example-db",
        ServerId = exampleServer.Id,
        Collation = "SQL_Latin1_General_CP1_CI_AS",
        SkuName = "S1",
    });

    var exampleJobAgent = new Azure.MSSql.JobAgent("example", new()
    {
        Name = "example-job-agent",
        Location = example.Location,
        DatabaseId = exampleDatabase.Id,
    });

    var exampleJobCredential = new Azure.MSSql.JobCredential("example", new()
    {
        Name = "example-job-credential",
        JobAgentId = exampleJobAgent.Id,
        Username = "testusername",
        Password = "testpassword",
    });

    var exampleJobTargetGroup = new Azure.MSSql.JobTargetGroup("example", new()
    {
        Name = "example-target-group",
        JobAgentId = exampleJobAgent.Id,
        JobTargets = new[]
        {
            new Azure.MSSql.Inputs.JobTargetGroupJobTargetArgs
            {
                ServerName = exampleServer.Name,
                DatabaseName = exampleDatabase.Name,
                JobCredentialId = exampleJobCredential.Id,
            },
        },
    });

    var exampleJob = new Azure.MSSql.Job("example", new()
    {
        Name = "example-job",
        JobAgentId = exampleJobAgent.Id,
        Description = "example description",
    });

    var test = new Azure.MSSql.JobStep("test", new()
    {
        Name = "example-job-step",
        JobId = exampleJob.Id,
        JobCredentialId = exampleJobCredential.Id,
        JobTargetGroupId = exampleJobTargetGroup.Id,
        JobStepIndex = 1,
        SqlScript = @"IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets')
  CREATE TABLE Pets (
    Animal NVARCHAR(50),
    Name NVARCHAR(50),
  );
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.mssql.Server;
import com.pulumi.azure.mssql.ServerArgs;
import com.pulumi.azure.mssql.Database;
import com.pulumi.azure.mssql.DatabaseArgs;
import com.pulumi.azure.mssql.JobAgent;
import com.pulumi.azure.mssql.JobAgentArgs;
import com.pulumi.azure.mssql.JobCredential;
import com.pulumi.azure.mssql.JobCredentialArgs;
import com.pulumi.azure.mssql.JobTargetGroup;
import com.pulumi.azure.mssql.JobTargetGroupArgs;
import com.pulumi.azure.mssql.inputs.JobTargetGroupJobTargetArgs;
import com.pulumi.azure.mssql.Job;
import com.pulumi.azure.mssql.JobArgs;
import com.pulumi.azure.mssql.JobStep;
import com.pulumi.azure.mssql.JobStepArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example")
            .location("westeurope")
            .build());

        var exampleServer = new Server("exampleServer", ServerArgs.builder()
            .name("example-server")
            .location(example.location())
            .resourceGroupName(example.name())
            .version("12.0")
            .administratorLogin("4dm1n157r470r")
            .administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
            .build());

        var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
            .name("example-db")
            .serverId(exampleServer.id())
            .collation("SQL_Latin1_General_CP1_CI_AS")
            .skuName("S1")
            .build());

        var exampleJobAgent = new JobAgent("exampleJobAgent", JobAgentArgs.builder()
            .name("example-job-agent")
            .location(example.location())
            .databaseId(exampleDatabase.id())
            .build());

        var exampleJobCredential = new JobCredential("exampleJobCredential", JobCredentialArgs.builder()
            .name("example-job-credential")
            .jobAgentId(exampleJobAgent.id())
            .username("testusername")
            .password("testpassword")
            .build());

        var exampleJobTargetGroup = new JobTargetGroup("exampleJobTargetGroup", JobTargetGroupArgs.builder()
            .name("example-target-group")
            .jobAgentId(exampleJobAgent.id())
            .jobTargets(JobTargetGroupJobTargetArgs.builder()
                .serverName(exampleServer.name())
                .databaseName(exampleDatabase.name())
                .jobCredentialId(exampleJobCredential.id())
                .build())
            .build());

        var exampleJob = new Job("exampleJob", JobArgs.builder()
            .name("example-job")
            .jobAgentId(exampleJobAgent.id())
            .description("example description")
            .build());

        var test = new JobStep("test", JobStepArgs.builder()
            .name("example-job-step")
            .jobId(exampleJob.id())
            .jobCredentialId(exampleJobCredential.id())
            .jobTargetGroupId(exampleJobTargetGroup.id())
            .jobStepIndex(1)
            .sqlScript("""
IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets')
  CREATE TABLE Pets (
    Animal NVARCHAR(50),
    Name NVARCHAR(50),
  );
            """)
            .build());

    }
}
Copy
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example
      location: westeurope
  exampleServer:
    type: azure:mssql:Server
    name: example
    properties:
      name: example-server
      location: ${example.location}
      resourceGroupName: ${example.name}
      version: '12.0'
      administratorLogin: 4dm1n157r470r
      administratorLoginPassword: 4-v3ry-53cr37-p455w0rd
  exampleDatabase:
    type: azure:mssql:Database
    name: example
    properties:
      name: example-db
      serverId: ${exampleServer.id}
      collation: SQL_Latin1_General_CP1_CI_AS
      skuName: S1
  exampleJobAgent:
    type: azure:mssql:JobAgent
    name: example
    properties:
      name: example-job-agent
      location: ${example.location}
      databaseId: ${exampleDatabase.id}
  exampleJobCredential:
    type: azure:mssql:JobCredential
    name: example
    properties:
      name: example-job-credential
      jobAgentId: ${exampleJobAgent.id}
      username: testusername
      password: testpassword
  exampleJobTargetGroup:
    type: azure:mssql:JobTargetGroup
    name: example
    properties:
      name: example-target-group
      jobAgentId: ${exampleJobAgent.id}
      jobTargets:
        - serverName: ${exampleServer.name}
          databaseName: ${exampleDatabase.name}
          jobCredentialId: ${exampleJobCredential.id}
  exampleJob:
    type: azure:mssql:Job
    name: example
    properties:
      name: example-job
      jobAgentId: ${exampleJobAgent.id}
      description: example description
  test:
    type: azure:mssql:JobStep
    properties:
      name: example-job-step
      jobId: ${exampleJob.id}
      jobCredentialId: ${exampleJobCredential.id}
      jobTargetGroupId: ${exampleJobTargetGroup.id}
      jobStepIndex: 1
      sqlScript: |
        IF NOT EXISTS (SELECT * FROM sys.objects WHERE [name] = N'Pets')
          CREATE TABLE Pets (
            Animal NVARCHAR(50),
            Name NVARCHAR(50),
          );        
Copy

Create JobStep Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new JobStep(name: string, args: JobStepArgs, opts?: CustomResourceOptions);
@overload
def JobStep(resource_name: str,
            args: JobStepArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def JobStep(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            job_credential_id: Optional[str] = None,
            job_id: Optional[str] = None,
            job_step_index: Optional[int] = None,
            job_target_group_id: Optional[str] = None,
            sql_script: Optional[str] = None,
            initial_retry_interval_seconds: Optional[int] = None,
            maximum_retry_interval_seconds: Optional[int] = None,
            name: Optional[str] = None,
            output_target: Optional[JobStepOutputTargetArgs] = None,
            retry_attempts: Optional[int] = None,
            retry_interval_backoff_multiplier: Optional[float] = None,
            timeout_seconds: Optional[int] = None)
func NewJobStep(ctx *Context, name string, args JobStepArgs, opts ...ResourceOption) (*JobStep, error)
public JobStep(string name, JobStepArgs args, CustomResourceOptions? opts = null)
public JobStep(String name, JobStepArgs args)
public JobStep(String name, JobStepArgs args, CustomResourceOptions options)
type: azure:mssql:JobStep
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. JobStepArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. JobStepArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. JobStepArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. JobStepArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. JobStepArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var jobStepResource = new Azure.MSSql.JobStep("jobStepResource", new()
{
    JobCredentialId = "string",
    JobId = "string",
    JobStepIndex = 0,
    JobTargetGroupId = "string",
    SqlScript = "string",
    InitialRetryIntervalSeconds = 0,
    MaximumRetryIntervalSeconds = 0,
    Name = "string",
    OutputTarget = new Azure.MSSql.Inputs.JobStepOutputTargetArgs
    {
        JobCredentialId = "string",
        MssqlDatabaseId = "string",
        TableName = "string",
        SchemaName = "string",
    },
    RetryAttempts = 0,
    RetryIntervalBackoffMultiplier = 0,
    TimeoutSeconds = 0,
});
Copy
example, err := mssql.NewJobStep(ctx, "jobStepResource", &mssql.JobStepArgs{
	JobCredentialId:             pulumi.String("string"),
	JobId:                       pulumi.String("string"),
	JobStepIndex:                pulumi.Int(0),
	JobTargetGroupId:            pulumi.String("string"),
	SqlScript:                   pulumi.String("string"),
	InitialRetryIntervalSeconds: pulumi.Int(0),
	MaximumRetryIntervalSeconds: pulumi.Int(0),
	Name:                        pulumi.String("string"),
	OutputTarget: &mssql.JobStepOutputTargetArgs{
		JobCredentialId: pulumi.String("string"),
		MssqlDatabaseId: pulumi.String("string"),
		TableName:       pulumi.String("string"),
		SchemaName:      pulumi.String("string"),
	},
	RetryAttempts:                  pulumi.Int(0),
	RetryIntervalBackoffMultiplier: pulumi.Float64(0),
	TimeoutSeconds:                 pulumi.Int(0),
})
Copy
var jobStepResource = new JobStep("jobStepResource", JobStepArgs.builder()
    .jobCredentialId("string")
    .jobId("string")
    .jobStepIndex(0)
    .jobTargetGroupId("string")
    .sqlScript("string")
    .initialRetryIntervalSeconds(0)
    .maximumRetryIntervalSeconds(0)
    .name("string")
    .outputTarget(JobStepOutputTargetArgs.builder()
        .jobCredentialId("string")
        .mssqlDatabaseId("string")
        .tableName("string")
        .schemaName("string")
        .build())
    .retryAttempts(0)
    .retryIntervalBackoffMultiplier(0)
    .timeoutSeconds(0)
    .build());
Copy
job_step_resource = azure.mssql.JobStep("jobStepResource",
    job_credential_id="string",
    job_id="string",
    job_step_index=0,
    job_target_group_id="string",
    sql_script="string",
    initial_retry_interval_seconds=0,
    maximum_retry_interval_seconds=0,
    name="string",
    output_target={
        "job_credential_id": "string",
        "mssql_database_id": "string",
        "table_name": "string",
        "schema_name": "string",
    },
    retry_attempts=0,
    retry_interval_backoff_multiplier=0,
    timeout_seconds=0)
Copy
const jobStepResource = new azure.mssql.JobStep("jobStepResource", {
    jobCredentialId: "string",
    jobId: "string",
    jobStepIndex: 0,
    jobTargetGroupId: "string",
    sqlScript: "string",
    initialRetryIntervalSeconds: 0,
    maximumRetryIntervalSeconds: 0,
    name: "string",
    outputTarget: {
        jobCredentialId: "string",
        mssqlDatabaseId: "string",
        tableName: "string",
        schemaName: "string",
    },
    retryAttempts: 0,
    retryIntervalBackoffMultiplier: 0,
    timeoutSeconds: 0,
});
Copy
type: azure:mssql:JobStep
properties:
    initialRetryIntervalSeconds: 0
    jobCredentialId: string
    jobId: string
    jobStepIndex: 0
    jobTargetGroupId: string
    maximumRetryIntervalSeconds: 0
    name: string
    outputTarget:
        jobCredentialId: string
        mssqlDatabaseId: string
        schemaName: string
        tableName: string
    retryAttempts: 0
    retryIntervalBackoffMultiplier: 0
    sqlScript: string
    timeoutSeconds: 0
Copy

JobStep Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The JobStep resource accepts the following input properties:

JobCredentialId This property is required. string
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
JobId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
JobStepIndex This property is required. int

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

JobTargetGroupId This property is required. string
The ID of the Elastic Job Target Group.
SqlScript This property is required. string

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

InitialRetryIntervalSeconds int
The initial retry interval in seconds. Defaults to 1.
MaximumRetryIntervalSeconds int

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

Name Changes to this property will trigger replacement. string
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
OutputTarget JobStepOutputTarget
An output_target block as defined below.
RetryAttempts int
The number of retry attempts. Defaults to 10.
RetryIntervalBackoffMultiplier double
The multiplier for time between retries. Defaults to 2.
TimeoutSeconds int
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
JobCredentialId This property is required. string
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
JobId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
JobStepIndex This property is required. int

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

JobTargetGroupId This property is required. string
The ID of the Elastic Job Target Group.
SqlScript This property is required. string

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

InitialRetryIntervalSeconds int
The initial retry interval in seconds. Defaults to 1.
MaximumRetryIntervalSeconds int

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

Name Changes to this property will trigger replacement. string
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
OutputTarget JobStepOutputTargetArgs
An output_target block as defined below.
RetryAttempts int
The number of retry attempts. Defaults to 10.
RetryIntervalBackoffMultiplier float64
The multiplier for time between retries. Defaults to 2.
TimeoutSeconds int
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
jobCredentialId This property is required. String
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
jobId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
jobStepIndex This property is required. Integer

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

jobTargetGroupId This property is required. String
The ID of the Elastic Job Target Group.
sqlScript This property is required. String

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

initialRetryIntervalSeconds Integer
The initial retry interval in seconds. Defaults to 1.
maximumRetryIntervalSeconds Integer

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. String
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
outputTarget JobStepOutputTarget
An output_target block as defined below.
retryAttempts Integer
The number of retry attempts. Defaults to 10.
retryIntervalBackoffMultiplier Double
The multiplier for time between retries. Defaults to 2.
timeoutSeconds Integer
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
jobCredentialId This property is required. string
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
jobId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
jobStepIndex This property is required. number

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

jobTargetGroupId This property is required. string
The ID of the Elastic Job Target Group.
sqlScript This property is required. string

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

initialRetryIntervalSeconds number
The initial retry interval in seconds. Defaults to 1.
maximumRetryIntervalSeconds number

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. string
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
outputTarget JobStepOutputTarget
An output_target block as defined below.
retryAttempts number
The number of retry attempts. Defaults to 10.
retryIntervalBackoffMultiplier number
The multiplier for time between retries. Defaults to 2.
timeoutSeconds number
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
job_credential_id This property is required. str
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
job_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
job_step_index This property is required. int

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

job_target_group_id This property is required. str
The ID of the Elastic Job Target Group.
sql_script This property is required. str

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

initial_retry_interval_seconds int
The initial retry interval in seconds. Defaults to 1.
maximum_retry_interval_seconds int

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. str
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
output_target JobStepOutputTargetArgs
An output_target block as defined below.
retry_attempts int
The number of retry attempts. Defaults to 10.
retry_interval_backoff_multiplier float
The multiplier for time between retries. Defaults to 2.
timeout_seconds int
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
jobCredentialId This property is required. String
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
jobId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
jobStepIndex This property is required. Number

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

jobTargetGroupId This property is required. String
The ID of the Elastic Job Target Group.
sqlScript This property is required. String

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

initialRetryIntervalSeconds Number
The initial retry interval in seconds. Defaults to 1.
maximumRetryIntervalSeconds Number

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. String
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
outputTarget Property Map
An output_target block as defined below.
retryAttempts Number
The number of retry attempts. Defaults to 10.
retryIntervalBackoffMultiplier Number
The multiplier for time between retries. Defaults to 2.
timeoutSeconds Number
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.

Outputs

All input properties are implicitly available as output properties. Additionally, the JobStep resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing JobStep Resource

Get an existing JobStep resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: JobStepState, opts?: CustomResourceOptions): JobStep
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        initial_retry_interval_seconds: Optional[int] = None,
        job_credential_id: Optional[str] = None,
        job_id: Optional[str] = None,
        job_step_index: Optional[int] = None,
        job_target_group_id: Optional[str] = None,
        maximum_retry_interval_seconds: Optional[int] = None,
        name: Optional[str] = None,
        output_target: Optional[JobStepOutputTargetArgs] = None,
        retry_attempts: Optional[int] = None,
        retry_interval_backoff_multiplier: Optional[float] = None,
        sql_script: Optional[str] = None,
        timeout_seconds: Optional[int] = None) -> JobStep
func GetJobStep(ctx *Context, name string, id IDInput, state *JobStepState, opts ...ResourceOption) (*JobStep, error)
public static JobStep Get(string name, Input<string> id, JobStepState? state, CustomResourceOptions? opts = null)
public static JobStep get(String name, Output<String> id, JobStepState state, CustomResourceOptions options)
resources:  _:    type: azure:mssql:JobStep    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
InitialRetryIntervalSeconds int
The initial retry interval in seconds. Defaults to 1.
JobCredentialId string
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
JobId Changes to this property will trigger replacement. string
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
JobStepIndex int

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

JobTargetGroupId string
The ID of the Elastic Job Target Group.
MaximumRetryIntervalSeconds int

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

Name Changes to this property will trigger replacement. string
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
OutputTarget JobStepOutputTarget
An output_target block as defined below.
RetryAttempts int
The number of retry attempts. Defaults to 10.
RetryIntervalBackoffMultiplier double
The multiplier for time between retries. Defaults to 2.
SqlScript string

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

TimeoutSeconds int
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
InitialRetryIntervalSeconds int
The initial retry interval in seconds. Defaults to 1.
JobCredentialId string
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
JobId Changes to this property will trigger replacement. string
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
JobStepIndex int

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

JobTargetGroupId string
The ID of the Elastic Job Target Group.
MaximumRetryIntervalSeconds int

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

Name Changes to this property will trigger replacement. string
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
OutputTarget JobStepOutputTargetArgs
An output_target block as defined below.
RetryAttempts int
The number of retry attempts. Defaults to 10.
RetryIntervalBackoffMultiplier float64
The multiplier for time between retries. Defaults to 2.
SqlScript string

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

TimeoutSeconds int
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
initialRetryIntervalSeconds Integer
The initial retry interval in seconds. Defaults to 1.
jobCredentialId String
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
jobId Changes to this property will trigger replacement. String
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
jobStepIndex Integer

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

jobTargetGroupId String
The ID of the Elastic Job Target Group.
maximumRetryIntervalSeconds Integer

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. String
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
outputTarget JobStepOutputTarget
An output_target block as defined below.
retryAttempts Integer
The number of retry attempts. Defaults to 10.
retryIntervalBackoffMultiplier Double
The multiplier for time between retries. Defaults to 2.
sqlScript String

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

timeoutSeconds Integer
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
initialRetryIntervalSeconds number
The initial retry interval in seconds. Defaults to 1.
jobCredentialId string
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
jobId Changes to this property will trigger replacement. string
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
jobStepIndex number

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

jobTargetGroupId string
The ID of the Elastic Job Target Group.
maximumRetryIntervalSeconds number

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. string
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
outputTarget JobStepOutputTarget
An output_target block as defined below.
retryAttempts number
The number of retry attempts. Defaults to 10.
retryIntervalBackoffMultiplier number
The multiplier for time between retries. Defaults to 2.
sqlScript string

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

timeoutSeconds number
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
initial_retry_interval_seconds int
The initial retry interval in seconds. Defaults to 1.
job_credential_id str
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
job_id Changes to this property will trigger replacement. str
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
job_step_index int

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

job_target_group_id str
The ID of the Elastic Job Target Group.
maximum_retry_interval_seconds int

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. str
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
output_target JobStepOutputTargetArgs
An output_target block as defined below.
retry_attempts int
The number of retry attempts. Defaults to 10.
retry_interval_backoff_multiplier float
The multiplier for time between retries. Defaults to 2.
sql_script str

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

timeout_seconds int
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.
initialRetryIntervalSeconds Number
The initial retry interval in seconds. Defaults to 1.
jobCredentialId String
The ID of the Elastic Job Credential to use when executing this Elastic Job Step.
jobId Changes to this property will trigger replacement. String
The ID of the Elastic Job. Changing this forces a new Elastic Job Step to be created.
jobStepIndex Number

The index at which to insert this Elastic Job Step into the Elastic Job.

Note: This value must be greater than or equal to 1 and less than or equal to the number of job steps in the Elastic Job.

jobTargetGroupId String
The ID of the Elastic Job Target Group.
maximumRetryIntervalSeconds Number

The maximum retry interval in seconds. Defaults to 120.

Note: maximum_retry_interval_seconds must be greater than initial_retry_interval_seconds.

name Changes to this property will trigger replacement. String
The name which should be used for this Elastic Job Step. Changing this forces a new Elastic Job Step to be created.
outputTarget Property Map
An output_target block as defined below.
retryAttempts Number
The number of retry attempts. Defaults to 10.
retryIntervalBackoffMultiplier Number
The multiplier for time between retries. Defaults to 2.
sqlScript String

The T-SQL script to be executed by this Elastic Job Step.

Note: While Azure places no restrictions on the script provided here, it is recommended to ensure the script is idempotent.

timeoutSeconds Number
The execution timeout in seconds for this Elastic Job Step. Defaults to 43200.

Supporting Types

JobStepOutputTarget
, JobStepOutputTargetArgs

JobCredentialId This property is required. string
The ID of the Elastic Job Credential to use when connecting to the output destination.
MssqlDatabaseId This property is required. string
The ID of the output database.
TableName This property is required. string
The name of the output table.
SchemaName string
The name of the output schema. Defaults to dbo.
JobCredentialId This property is required. string
The ID of the Elastic Job Credential to use when connecting to the output destination.
MssqlDatabaseId This property is required. string
The ID of the output database.
TableName This property is required. string
The name of the output table.
SchemaName string
The name of the output schema. Defaults to dbo.
jobCredentialId This property is required. String
The ID of the Elastic Job Credential to use when connecting to the output destination.
mssqlDatabaseId This property is required. String
The ID of the output database.
tableName This property is required. String
The name of the output table.
schemaName String
The name of the output schema. Defaults to dbo.
jobCredentialId This property is required. string
The ID of the Elastic Job Credential to use when connecting to the output destination.
mssqlDatabaseId This property is required. string
The ID of the output database.
tableName This property is required. string
The name of the output table.
schemaName string
The name of the output schema. Defaults to dbo.
job_credential_id This property is required. str
The ID of the Elastic Job Credential to use when connecting to the output destination.
mssql_database_id This property is required. str
The ID of the output database.
table_name This property is required. str
The name of the output table.
schema_name str
The name of the output schema. Defaults to dbo.
jobCredentialId This property is required. String
The ID of the Elastic Job Credential to use when connecting to the output destination.
mssqlDatabaseId This property is required. String
The ID of the output database.
tableName This property is required. String
The name of the output table.
schemaName String
The name of the output schema. Defaults to dbo.

Import

Elastic Job Steps can be imported using the resource id, e.g.

$ pulumi import azure:mssql/jobStep:JobStep example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Sql/servers/myserver1/jobAgents/myjobagent1/jobs/myjob1/steps/myjobstep1
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.