1. Packages
  2. Azure Native v2
  3. API Docs
  4. sql
  5. Job
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.sql.Job

Explore with Pulumi AI

A job. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.

Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview.

Example Usage

Create a job with all properties specified

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var job = new AzureNative.Sql.Job("job", new()
    {
        Description = "my favourite job",
        JobAgentName = "agent1",
        JobName = "job1",
        ResourceGroupName = "group1",
        Schedule = new AzureNative.Sql.Inputs.JobScheduleArgs
        {
            Enabled = true,
            EndTime = "2015-09-24T23:59:59Z",
            Interval = "PT5M",
            StartTime = "2015-09-24T18:30:01Z",
            Type = AzureNative.Sql.JobScheduleType.Recurring,
        },
        ServerName = "server1",
    });

});
Copy
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.NewJob(ctx, "job", &sql.JobArgs{
			Description:       pulumi.String("my favourite job"),
			JobAgentName:      pulumi.String("agent1"),
			JobName:           pulumi.String("job1"),
			ResourceGroupName: pulumi.String("group1"),
			Schedule: &sql.JobScheduleArgs{
				Enabled:   pulumi.Bool(true),
				EndTime:   pulumi.String("2015-09-24T23:59:59Z"),
				Interval:  pulumi.String("PT5M"),
				StartTime: pulumi.String("2015-09-24T18:30:01Z"),
				Type:      sql.JobScheduleTypeRecurring,
			},
			ServerName: pulumi.String("server1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.Job;
import com.pulumi.azurenative.sql.JobArgs;
import com.pulumi.azurenative.sql.inputs.JobScheduleArgs;
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 job = new Job("job", JobArgs.builder()
            .description("my favourite job")
            .jobAgentName("agent1")
            .jobName("job1")
            .resourceGroupName("group1")
            .schedule(JobScheduleArgs.builder()
                .enabled(true)
                .endTime("2015-09-24T23:59:59Z")
                .interval("PT5M")
                .startTime("2015-09-24T18:30:01Z")
                .type("Recurring")
                .build())
            .serverName("server1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const job = new azure_native.sql.Job("job", {
    description: "my favourite job",
    jobAgentName: "agent1",
    jobName: "job1",
    resourceGroupName: "group1",
    schedule: {
        enabled: true,
        endTime: "2015-09-24T23:59:59Z",
        interval: "PT5M",
        startTime: "2015-09-24T18:30:01Z",
        type: azure_native.sql.JobScheduleType.Recurring,
    },
    serverName: "server1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

job = azure_native.sql.Job("job",
    description="my favourite job",
    job_agent_name="agent1",
    job_name="job1",
    resource_group_name="group1",
    schedule={
        "enabled": True,
        "end_time": "2015-09-24T23:59:59Z",
        "interval": "PT5M",
        "start_time": "2015-09-24T18:30:01Z",
        "type": azure_native.sql.JobScheduleType.RECURRING,
    },
    server_name="server1")
Copy
resources:
  job:
    type: azure-native:sql:Job
    properties:
      description: my favourite job
      jobAgentName: agent1
      jobName: job1
      resourceGroupName: group1
      schedule:
        enabled: true
        endTime: 2015-09-24T23:59:59Z
        interval: PT5M
        startTime: 2015-09-24T18:30:01Z
        type: Recurring
      serverName: server1
Copy

Create a job with default properties

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var job = new AzureNative.Sql.Job("job", new()
    {
        JobAgentName = "agent1",
        JobName = "job1",
        ResourceGroupName = "group1",
        ServerName = "server1",
    });

});
Copy
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.NewJob(ctx, "job", &sql.JobArgs{
			JobAgentName:      pulumi.String("agent1"),
			JobName:           pulumi.String("job1"),
			ResourceGroupName: pulumi.String("group1"),
			ServerName:        pulumi.String("server1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.sql.Job;
import com.pulumi.azurenative.sql.JobArgs;
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 job = new Job("job", JobArgs.builder()
            .jobAgentName("agent1")
            .jobName("job1")
            .resourceGroupName("group1")
            .serverName("server1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const job = new azure_native.sql.Job("job", {
    jobAgentName: "agent1",
    jobName: "job1",
    resourceGroupName: "group1",
    serverName: "server1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

job = azure_native.sql.Job("job",
    job_agent_name="agent1",
    job_name="job1",
    resource_group_name="group1",
    server_name="server1")
Copy
resources:
  job:
    type: azure-native:sql:Job
    properties:
      jobAgentName: agent1
      jobName: job1
      resourceGroupName: group1
      serverName: server1
Copy

Create Job Resource

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

Constructor syntax

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

@overload
def Job(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        job_agent_name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        server_name: Optional[str] = None,
        description: Optional[str] = None,
        job_name: Optional[str] = None,
        schedule: Optional[JobScheduleArgs] = None)
func NewJob(ctx *Context, name string, args JobArgs, opts ...ResourceOption) (*Job, error)
public Job(string name, JobArgs args, CustomResourceOptions? opts = null)
public Job(String name, JobArgs args)
public Job(String name, JobArgs args, CustomResourceOptions options)
type: azure-native:sql:Job
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. JobArgs
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. JobArgs
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. JobArgs
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. JobArgs
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. JobArgs
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 examplejobResourceResourceFromSql = new AzureNative.Sql.Job("examplejobResourceResourceFromSql", new()
{
    JobAgentName = "string",
    ResourceGroupName = "string",
    ServerName = "string",
    Description = "string",
    JobName = "string",
    Schedule = 
    {
        { "enabled", false },
        { "endTime", "string" },
        { "interval", "string" },
        { "startTime", "string" },
        { "type", "Once" },
    },
});
Copy
example, err := sql.NewJob(ctx, "examplejobResourceResourceFromSql", &sql.JobArgs{
	JobAgentName:      "string",
	ResourceGroupName: "string",
	ServerName:        "string",
	Description:       "string",
	JobName:           "string",
	Schedule: map[string]interface{}{
		"enabled":   false,
		"endTime":   "string",
		"interval":  "string",
		"startTime": "string",
		"type":      "Once",
	},
})
Copy
var examplejobResourceResourceFromSql = new Job("examplejobResourceResourceFromSql", JobArgs.builder()
    .jobAgentName("string")
    .resourceGroupName("string")
    .serverName("string")
    .description("string")
    .jobName("string")
    .schedule(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
examplejob_resource_resource_from_sql = azure_native.sql.Job("examplejobResourceResourceFromSql",
    job_agent_name=string,
    resource_group_name=string,
    server_name=string,
    description=string,
    job_name=string,
    schedule={
        enabled: False,
        endTime: string,
        interval: string,
        startTime: string,
        type: Once,
    })
Copy
const examplejobResourceResourceFromSql = new azure_native.sql.Job("examplejobResourceResourceFromSql", {
    jobAgentName: "string",
    resourceGroupName: "string",
    serverName: "string",
    description: "string",
    jobName: "string",
    schedule: {
        enabled: false,
        endTime: "string",
        interval: "string",
        startTime: "string",
        type: "Once",
    },
});
Copy
type: azure-native:sql:Job
properties:
    description: string
    jobAgentName: string
    jobName: string
    resourceGroupName: string
    schedule:
        enabled: false
        endTime: string
        interval: string
        startTime: string
        type: Once
    serverName: string
Copy

Job 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 Job resource accepts the following input properties:

JobAgentName
This property is required.
Changes to this property will trigger replacement.
string
The name of the job agent.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
Description string
User-defined description of the job.
JobName Changes to this property will trigger replacement. string
The name of the job to get.
Schedule Pulumi.AzureNative.Sql.Inputs.JobSchedule
Schedule properties of the job.
JobAgentName
This property is required.
Changes to this property will trigger replacement.
string
The name of the job agent.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
Description string
User-defined description of the job.
JobName Changes to this property will trigger replacement. string
The name of the job to get.
Schedule JobScheduleArgs
Schedule properties of the job.
jobAgentName
This property is required.
Changes to this property will trigger replacement.
String
The name of the job agent.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
description String
User-defined description of the job.
jobName Changes to this property will trigger replacement. String
The name of the job to get.
schedule JobSchedule
Schedule properties of the job.
jobAgentName
This property is required.
Changes to this property will trigger replacement.
string
The name of the job agent.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
description string
User-defined description of the job.
jobName Changes to this property will trigger replacement. string
The name of the job to get.
schedule JobSchedule
Schedule properties of the job.
job_agent_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the job agent.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
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_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the server.
description str
User-defined description of the job.
job_name Changes to this property will trigger replacement. str
The name of the job to get.
schedule JobScheduleArgs
Schedule properties of the job.
jobAgentName
This property is required.
Changes to this property will trigger replacement.
String
The name of the job agent.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
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
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
description String
User-defined description of the job.
jobName Changes to this property will trigger replacement. String
The name of the job to get.
schedule Property Map
Schedule properties of the job.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
Type string
Resource type.
Version int
The job version number.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Resource name.
Type string
Resource type.
Version int
The job version number.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
type String
Resource type.
version Integer
The job version number.
id string
The provider-assigned unique ID for this managed resource.
name string
Resource name.
type string
Resource type.
version number
The job version number.
id str
The provider-assigned unique ID for this managed resource.
name str
Resource name.
type str
Resource type.
version int
The job version number.
id String
The provider-assigned unique ID for this managed resource.
name String
Resource name.
type String
Resource type.
version Number
The job version number.

Supporting Types

JobSchedule
, JobScheduleArgs

Enabled bool
Whether or not the schedule is enabled.
EndTime string
Schedule end time.
Interval string
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
StartTime string
Schedule start time.
Type Pulumi.AzureNative.Sql.JobScheduleType
Schedule interval type
Enabled bool
Whether or not the schedule is enabled.
EndTime string
Schedule end time.
Interval string
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
StartTime string
Schedule start time.
Type JobScheduleType
Schedule interval type
enabled Boolean
Whether or not the schedule is enabled.
endTime String
Schedule end time.
interval String
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
startTime String
Schedule start time.
type JobScheduleType
Schedule interval type
enabled boolean
Whether or not the schedule is enabled.
endTime string
Schedule end time.
interval string
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
startTime string
Schedule start time.
type JobScheduleType
Schedule interval type
enabled bool
Whether or not the schedule is enabled.
end_time str
Schedule end time.
interval str
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
start_time str
Schedule start time.
type JobScheduleType
Schedule interval type
enabled Boolean
Whether or not the schedule is enabled.
endTime String
Schedule end time.
interval String
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
startTime String
Schedule start time.
type "Once" | "Recurring"
Schedule interval type

JobScheduleResponse
, JobScheduleResponseArgs

Enabled bool
Whether or not the schedule is enabled.
EndTime string
Schedule end time.
Interval string
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
StartTime string
Schedule start time.
Type string
Schedule interval type
Enabled bool
Whether or not the schedule is enabled.
EndTime string
Schedule end time.
Interval string
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
StartTime string
Schedule start time.
Type string
Schedule interval type
enabled Boolean
Whether or not the schedule is enabled.
endTime String
Schedule end time.
interval String
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
startTime String
Schedule start time.
type String
Schedule interval type
enabled boolean
Whether or not the schedule is enabled.
endTime string
Schedule end time.
interval string
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
startTime string
Schedule start time.
type string
Schedule interval type
enabled bool
Whether or not the schedule is enabled.
end_time str
Schedule end time.
interval str
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
start_time str
Schedule start time.
type str
Schedule interval type
enabled Boolean
Whether or not the schedule is enabled.
endTime String
Schedule end time.
interval String
Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration format.
startTime String
Schedule start time.
type String
Schedule interval type

JobScheduleType
, JobScheduleTypeArgs

Once
Once
Recurring
Recurring
JobScheduleTypeOnce
Once
JobScheduleTypeRecurring
Recurring
Once
Once
Recurring
Recurring
Once
Once
Recurring
Recurring
ONCE
Once
RECURRING
Recurring
"Once"
Once
"Recurring"
Recurring

Import

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

$ pulumi import azure-native:sql:Job job1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName} 
Copy

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

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0