JobStep

class JobStep : KotlinCustomResource

A job step. Uses Azure REST API version 2023-08-01. In version 2.x of the Azure Native provider, it used API version 2021-11-01. Other available API versions: 2017-03-01-preview, 2020-02-02-preview, 2020-08-01-preview, 2020-11-01-preview, 2021-02-01-preview, 2021-05-01-preview, 2021-08-01-preview, 2021-11-01, 2021-11-01-preview, 2022-02-01-preview, 2022-05-01-preview, 2022-08-01-preview, 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native sql [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create or update a job step with all properties specified.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var jobStep = new AzureNative.Sql.JobStep("jobStep", new()
{
Action = new AzureNative.Sql.Inputs.JobStepActionArgs
{
Source = AzureNative.Sql.JobStepActionSource.Inline,
Type = AzureNative.Sql.JobStepActionType.TSql,
Value = "select 2",
},
Credential = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1",
ExecutionOptions = new AzureNative.Sql.Inputs.JobStepExecutionOptionsArgs
{
InitialRetryIntervalSeconds = 11,
MaximumRetryIntervalSeconds = 222,
RetryAttempts = 42,
RetryIntervalBackoffMultiplier = 3,
TimeoutSeconds = 1234,
},
JobAgentName = "agent1",
JobName = "job1",
Output = new AzureNative.Sql.Inputs.JobStepOutputArgs
{
Credential = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0",
DatabaseName = "database3",
ResourceGroupName = "group3",
SchemaName = "myschema1234",
ServerName = "server3",
SubscriptionId = "3501b905-a848-4b5d-96e8-b253f62d735a",
TableName = "mytable5678",
Type = AzureNative.Sql.JobStepOutputType.SqlDatabase,
},
ResourceGroupName = "group1",
ServerName = "server1",
StepId = 1,
StepName = "step1",
TargetGroup = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewJobStep(ctx, "jobStep", &sql.JobStepArgs{
Action: &sql.JobStepActionArgs{
Source: pulumi.String(sql.JobStepActionSourceInline),
Type: pulumi.String(sql.JobStepActionTypeTSql),
Value: pulumi.String("select 2"),
},
Credential: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"),
ExecutionOptions: &sql.JobStepExecutionOptionsArgs{
InitialRetryIntervalSeconds: pulumi.Int(11),
MaximumRetryIntervalSeconds: pulumi.Int(222),
RetryAttempts: pulumi.Int(42),
RetryIntervalBackoffMultiplier: pulumi.Float64(3),
TimeoutSeconds: pulumi.Int(1234),
},
JobAgentName: pulumi.String("agent1"),
JobName: pulumi.String("job1"),
Output: &sql.JobStepOutputTypeArgs{
Credential: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"),
DatabaseName: pulumi.String("database3"),
ResourceGroupName: pulumi.String("group3"),
SchemaName: pulumi.String("myschema1234"),
ServerName: pulumi.String("server3"),
SubscriptionId: pulumi.String("3501b905-a848-4b5d-96e8-b253f62d735a"),
TableName: pulumi.String("mytable5678"),
Type: pulumi.String(sql.JobStepOutputTypeSqlDatabase),
},
ResourceGroupName: pulumi.String("group1"),
ServerName: pulumi.String("server1"),
StepId: pulumi.Int(1),
StepName: pulumi.String("step1"),
TargetGroup: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.JobStep;
import com.pulumi.azurenative.sql.JobStepArgs;
import com.pulumi.azurenative.sql.inputs.JobStepActionArgs;
import com.pulumi.azurenative.sql.inputs.JobStepExecutionOptionsArgs;
import com.pulumi.azurenative.sql.inputs.JobStepOutputArgs;
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 jobStep = new JobStep("jobStep", JobStepArgs.builder()
.action(JobStepActionArgs.builder()
.source("Inline")
.type("TSql")
.value("select 2")
.build())
.credential("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1")
.executionOptions(JobStepExecutionOptionsArgs.builder()
.initialRetryIntervalSeconds(11)
.maximumRetryIntervalSeconds(222)
.retryAttempts(42)
.retryIntervalBackoffMultiplier(3)
.timeoutSeconds(1234)
.build())
.jobAgentName("agent1")
.jobName("job1")
.output(JobStepOutputArgs.builder()
.credential("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0")
.databaseName("database3")
.resourceGroupName("group3")
.schemaName("myschema1234")
.serverName("server3")
.subscriptionId("3501b905-a848-4b5d-96e8-b253f62d735a")
.tableName("mytable5678")
.type("SqlDatabase")
.build())
.resourceGroupName("group1")
.serverName("server1")
.stepId(1)
.stepName("step1")
.targetGroup("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1")
.build());
}
}

Create or update a job step with minimal properties specified.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var jobStep = new AzureNative.Sql.JobStep("jobStep", new()
{
Action = new AzureNative.Sql.Inputs.JobStepActionArgs
{
Value = "select 1",
},
JobAgentName = "agent1",
JobName = "job1",
ResourceGroupName = "group1",
ServerName = "server1",
StepName = "step1",
TargetGroup = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0",
});
});
package main
import (
sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sql.NewJobStep(ctx, "jobStep", &sql.JobStepArgs{
Action: &sql.JobStepActionArgs{
Value: pulumi.String("select 1"),
},
JobAgentName: pulumi.String("agent1"),
JobName: pulumi.String("job1"),
ResourceGroupName: pulumi.String("group1"),
ServerName: pulumi.String("server1"),
StepName: pulumi.String("step1"),
TargetGroup: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.JobStep;
import com.pulumi.azurenative.sql.JobStepArgs;
import com.pulumi.azurenative.sql.inputs.JobStepActionArgs;
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 jobStep = new JobStep("jobStep", JobStepArgs.builder()
.action(JobStepActionArgs.builder()
.value("select 1")
.build())
.jobAgentName("agent1")
.jobName("job1")
.resourceGroupName("group1")
.serverName("server1")
.stepName("step1")
.targetGroup("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:sql:JobStep step1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}

Properties

Link copied to clipboard

The action payload of the job step.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val credential: Output<String>?

The resource ID of the job credential that will be used to connect to the targets.

Link copied to clipboard

Execution options for the job step.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

Output destination properties of the job step.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val stepId: Output<Int>?

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.

Link copied to clipboard
val targetGroup: Output<String>

The resource ID of the target group that the job step will be executed on.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>