Module scheduler

@pulumi/azure > scheduler

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class Job

extends CustomResource

Manages a Scheduler Job.

NOTE: Support for Scheduler Job has been deprecated by Microsoft in favour of Logic Apps (more information can be found at this link) - as such we plan to remove support for this resource as a part of version 2.0 of the AzureRM Provider.

Example Usage (single web get now)

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

const webOnceNow = new azure.scheduler.Job("web-once-now", {
    actionWeb: {
        // defaults to get
        url: "http://this.url.fails",
    },
    jobCollectionName: azurerm_scheduler_job_collection_example.name,
    name: "tfex-web-once-now",
    resourceGroupName: azurerm_resource_group_example.name,
    // re-enable it each run
    state: "enabled",
});

Example Usage (recurring daily with retry and basic authentication)

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

const webRecurringDaily = new azure.scheduler.Job("web-recurring-daily", {
    actionWeb: {
        authenticationBasic: {
            password: "apassword",
            username: "login",
        },
        body: "this is some text",
        headers: {
            "Content-Type": "text",
        },
        method: "put",
        url: "https://this.url.fails",
    },
    jobCollectionName: azurerm_scheduler_job_collection_example.name,
    name: "tfex-web-recurring-daily",
    recurrence: {
        count: 1000,
        frequency: "day",
        // run 4 times an hour every 12 hours
        hours: [
            0,
            12,
        ],
        minutes: [
            0,
            15,
            30,
            45,
        ],
    },
    resourceGroupName: azurerm_resource_group_example.name,
    retry: {
        count: 10,
        // retry every 5 min a maximum of 10 times
        interval: "00:05:00",
    },
    startTime: "2018-07-07T07:07:07-07:00",
});

Example Usage (recurring monthly with an error action and client certificate authentication)

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

const webRecurringDaily = new azure.scheduler.Job("web-recurring-daily", {
    actionWeb: {
        authenticationCertificate: {
            password: "certPassword",
            pfx: (() => {
                throw "tf2pulumi error: NYI: call to filebase64";
                return (() => { throw "NYI: call to filebase64"; })();
            })(),
        },
        url: "https://this.url.fails",
    },
    errorActionWeb: {
        authenticationBasic: {
            password: "apassword",
            username: "login",
        },
        body: "The job failed",
        headers: {
            "Content-Type": "text",
        },
        method: "put",
        url: "https://this.url.fails",
    },
    jobCollectionName: azurerm_scheduler_job_collection_example.name,
    name: "tfex-web-recurring-daily",
    recurrence: {
        count: 1000,
        frequency: "monthly",
        monthlyOccurrences: [
            {
                // first Sunday
                day: "Sunday",
                occurrence: 1,
            },
            {
                // third Sunday
                day: "Sunday",
                occurrence: 3,
            },
            {
                // last Sunday
                day: "Sunday",
                occurrence: -1,
            },
        ],
    },
    resourceGroupName: azurerm_resource_group_example.name,
    startTime: "2018-07-07T07:07:07-07:00",
});

Example Usage (storage queue action)

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

const exampleAccount = new azure.storage.Account("example", {
    accountReplicationType: "LRS",
    accountTier: "Standard",
    location: azurerm_resource_group_example.location,
    name: "tfexstorageaccount",
    resourceGroupName: azurerm_resource_group_example.name,
});
const exampleQueue = new azure.storage.Queue("example", {
    name: "tfex-schedulerjob-storagequeue",
    resourceGroupName: azurerm_resource_group_example.name,
    storageAccountName: exampleAccount.name,
});
const storageOnceNow = new azure.scheduler.Job("storage-once-now", {
    actionStorageQueue: {
        message: "storage message",
        sasToken: exampleAccount.primaryAccessKey,
        storageAccountName: exampleAccount.name,
        storageQueueName: exampleQueue.name,
    },
    jobCollectionName: azurerm_scheduler_job_collection_example.name,
    name: "tfex-storage-once-now",
    resourceGroupName: azurerm_resource_group_example.name,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/scheduler_job.html.markdown.

constructor

new Job(name: string, args: JobArgs, opts?: pulumi.CustomResourceOptions)

Create a Job resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: JobState, opts?: pulumi.CustomResourceOptions): Job

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Job. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property actionStorageQueue

public actionStorageQueue: pulumi.Output<{
    message: string;
    sasToken: string;
    storageAccountName: string;
    storageQueueName: string;
} | undefined>;

A actionStorageQueue block defining a storage queue job action as described below. Note this is identical to an errorActionStorageQueue block.

property actionWeb

public actionWeb: pulumi.Output<{
    authenticationActiveDirectory: undefined | {
        audience: string;
        clientId: string;
        secret: string;
        tenantId: string;
    };
    authenticationBasic: undefined | {
        password: string;
        username: string;
    };
    authenticationCertificate: undefined | {
        expiration: string;
        password: string;
        pfx: string;
        subjectName: string;
        thumbprint: string;
    };
    body: undefined | string;
    headers: undefined | {[key: string]: any};
    method: string;
    url: string;
} | undefined>;

A actionWeb block defining the job action as described below. Note this is identical to an errorActionWeb block.

property errorActionStorageQueue

public errorActionStorageQueue: pulumi.Output<{
    message: string;
    sasToken: string;
    storageAccountName: string;
    storageQueueName: string;
} | undefined>;

A errorActionStorageQueue block defining the a web action to take on an error as described below. Note this is identical to an actionStorageQueue block.

property errorActionWeb

public errorActionWeb: pulumi.Output<{
    authenticationActiveDirectory: undefined | {
        audience: string;
        clientId: string;
        secret: string;
        tenantId: string;
    };
    authenticationBasic: undefined | {
        password: string;
        username: string;
    };
    authenticationCertificate: undefined | {
        expiration: string;
        password: string;
        pfx: string;
        subjectName: string;
        thumbprint: string;
    };
    body: undefined | string;
    headers: undefined | {[key: string]: any};
    method: string;
    url: string;
} | undefined>;

A errorActionWeb block defining the action to take on an error as described below. Note this is identical to an actionWeb block.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property jobCollectionName

public jobCollectionName: pulumi.Output<string>;

Specifies the name of the Scheduler Job Collection in which the Job should exist. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

The name of the Scheduler Job. Changing this forces a new resource to be created.

property recurrence

public recurrence: pulumi.Output<{
    count: undefined | number;
    endTime: string;
    frequency: string;
    hours: number[];
    interval: undefined | number;
    minutes: number[];
    monthDays: number[];
    monthlyOccurrences: {
        day: string;
        occurrence: number;
    }[];
    weekDays: string[];
} | undefined>;

A recurrence block defining a job occurrence schedule.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Scheduler Job. Changing this forces a new resource to be created.

property retry

public retry: pulumi.Output<{
    count: undefined | number;
    interval: undefined | string;
} | undefined>;

A retry block defining how to retry as described below.

property startTime

public startTime: pulumi.Output<string>;

The time the first instance of the job is to start running at.

property state

public state: pulumi.Output<string>;

The sets or gets the current state of the job. Can be set to either Enabled or Completed

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class JobCollection

extends CustomResource

Manages a Scheduler Job Collection.

NOTE: Support for Scheduler Job Collections has been deprecated by Microsoft in favour of Logic Apps (more information can be found at this link) - as such we plan to remove support for this resource as a part of version 2.0 of the AzureRM Provider.

Example Usage

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

const rg = new azure.core.ResourceGroup("rg", {
    location: "West US",
    name: "tfex-job_collection",
});
const jobs = new azure.scheduler.JobCollection("jobs", {
    location: rg.location,
    name: "exampleJobCollection",
    quota: {
        maxJobCount: 5,
        maxRecurrenceFrequency: "hour",
        maxRecurrenceInterval: 24,
    },
    resourceGroupName: rg.name,
    sku: "free",
    state: "enabled",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/scheduler_job_collection.html.markdown.

constructor

new JobCollection(name: string, args: JobCollectionArgs, opts?: pulumi.CustomResourceOptions)

Create a JobCollection resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: JobCollectionState, opts?: pulumi.CustomResourceOptions): JobCollection

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of JobCollection. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

Specifies the name of the Scheduler Job Collection. Changing this forces a new resource to be created.

property quota

public quota: pulumi.Output<{
    maxJobCount: undefined | number;
    maxRecurrenceFrequency: string;
    maxRecurrenceInterval: undefined | number;
    maxRetryInterval: number;
} | undefined>;

Configures the Job collection quotas as documented in the quota block below.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Scheduler Job Collection. Changing this forces a new resource to be created.

property sku

public sku: pulumi.Output<string>;

Sets the Job Collection’s pricing level’s SKU. Possible values include: Standard, Free, P10Premium, P20Premium.

property state

public state: pulumi.Output<string | undefined>;

Sets Job Collection’s state. Possible values include: Enabled, Disabled, Suspended.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getJobCollection

getJobCollection(args: GetJobCollectionArgs, opts?: pulumi.InvokeOptions): Promise<GetJobCollectionResult> & GetJobCollectionResult

Use this data source to access information about an existing Scheduler Job Collection.

NOTE: Support for Scheduler Job Collections has been deprecated by Microsoft in favour of Logic Apps (more information can be found at this link) - as such we plan to remove support for this data source as a part of version 2.0 of the AzureRM Provider.

Example Usage

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

const test = pulumi.output(azure.scheduler.getJobCollection({
    name: "tfex-job-collection",
    resourceGroupName: "tfex-job-collection-rg",
}));

export const jobCollectionState = azurerm_scheduler_job_collection_jobs.state;

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/d/scheduler_job_collection.html.markdown.

interface GetJobCollectionArgs

A collection of arguments for invoking getJobCollection.

property name

name: string;

Specifies the name of the Scheduler Job Collection.

property resourceGroupName

resourceGroupName: string;

Specifies the name of the resource group in which the Scheduler Job Collection resides.

interface GetJobCollectionResult

A collection of values returned by getJobCollection.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property location

location: string;

The Azure location where the resource exists.

property name

name: string;

property quotas

quotas: {
    maxJobCount: number;
    maxRecurrenceFrequency: string;
    maxRecurrenceInterval: number;
    maxRetryInterval: number;
}[];

The Job collection quotas as documented in the quota block below.

property resourceGroupName

resourceGroupName: string;

property sku

sku: string;

The Job Collection’s pricing level’s SKU.

property state

state: string;

The Job Collection’s state.

property tags

tags: {[key: string]: any};

A mapping of tags assigned to the resource.

interface JobArgs

The set of arguments for constructing a Job resource.

property actionStorageQueue

actionStorageQueue?: pulumi.Input<{
    message: pulumi.Input<string>;
    sasToken: pulumi.Input<string>;
    storageAccountName: pulumi.Input<string>;
    storageQueueName: pulumi.Input<string>;
}>;

A actionStorageQueue block defining a storage queue job action as described below. Note this is identical to an errorActionStorageQueue block.

property actionWeb

actionWeb?: pulumi.Input<{
    authenticationActiveDirectory: pulumi.Input<{
        audience: pulumi.Input<string>;
        clientId: pulumi.Input<string>;
        secret: pulumi.Input<string>;
        tenantId: pulumi.Input<string>;
    }>;
    authenticationBasic: pulumi.Input<{
        password: pulumi.Input<string>;
        username: pulumi.Input<string>;
    }>;
    authenticationCertificate: pulumi.Input<{
        expiration: pulumi.Input<string>;
        password: pulumi.Input<string>;
        pfx: pulumi.Input<string>;
        subjectName: pulumi.Input<string>;
        thumbprint: pulumi.Input<string>;
    }>;
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: any}>;
    method: pulumi.Input<string>;
    url: pulumi.Input<string>;
}>;

A actionWeb block defining the job action as described below. Note this is identical to an errorActionWeb block.

property errorActionStorageQueue

errorActionStorageQueue?: pulumi.Input<{
    message: pulumi.Input<string>;
    sasToken: pulumi.Input<string>;
    storageAccountName: pulumi.Input<string>;
    storageQueueName: pulumi.Input<string>;
}>;

A errorActionStorageQueue block defining the a web action to take on an error as described below. Note this is identical to an actionStorageQueue block.

property errorActionWeb

errorActionWeb?: pulumi.Input<{
    authenticationActiveDirectory: pulumi.Input<{
        audience: pulumi.Input<string>;
        clientId: pulumi.Input<string>;
        secret: pulumi.Input<string>;
        tenantId: pulumi.Input<string>;
    }>;
    authenticationBasic: pulumi.Input<{
        password: pulumi.Input<string>;
        username: pulumi.Input<string>;
    }>;
    authenticationCertificate: pulumi.Input<{
        expiration: pulumi.Input<string>;
        password: pulumi.Input<string>;
        pfx: pulumi.Input<string>;
        subjectName: pulumi.Input<string>;
        thumbprint: pulumi.Input<string>;
    }>;
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: any}>;
    method: pulumi.Input<string>;
    url: pulumi.Input<string>;
}>;

A errorActionWeb block defining the action to take on an error as described below. Note this is identical to an actionWeb block.

property jobCollectionName

jobCollectionName: pulumi.Input<string>;

Specifies the name of the Scheduler Job Collection in which the Job should exist. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the Scheduler Job. Changing this forces a new resource to be created.

property recurrence

recurrence?: pulumi.Input<{
    count: pulumi.Input<number>;
    endTime: pulumi.Input<string>;
    frequency: pulumi.Input<string>;
    hours: pulumi.Input<pulumi.Input<number>[]>;
    interval: pulumi.Input<number>;
    minutes: pulumi.Input<pulumi.Input<number>[]>;
    monthDays: pulumi.Input<pulumi.Input<number>[]>;
    monthlyOccurrences: pulumi.Input<pulumi.Input<{
        day: pulumi.Input<string>;
        occurrence: pulumi.Input<number>;
    }>[]>;
    weekDays: pulumi.Input<pulumi.Input<string>[]>;
}>;

A recurrence block defining a job occurrence schedule.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Scheduler Job. Changing this forces a new resource to be created.

property retry

retry?: pulumi.Input<{
    count: pulumi.Input<number>;
    interval: pulumi.Input<string>;
}>;

A retry block defining how to retry as described below.

property startTime

startTime?: pulumi.Input<string>;

The time the first instance of the job is to start running at.

property state

state?: pulumi.Input<string>;

The sets or gets the current state of the job. Can be set to either Enabled or Completed

interface JobCollectionArgs

The set of arguments for constructing a JobCollection resource.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Scheduler Job Collection. Changing this forces a new resource to be created.

property quota

quota?: pulumi.Input<{
    maxJobCount: pulumi.Input<number>;
    maxRecurrenceFrequency: pulumi.Input<string>;
    maxRecurrenceInterval: pulumi.Input<number>;
    maxRetryInterval: pulumi.Input<number>;
}>;

Configures the Job collection quotas as documented in the quota block below.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Scheduler Job Collection. Changing this forces a new resource to be created.

property sku

sku: pulumi.Input<string>;

Sets the Job Collection’s pricing level’s SKU. Possible values include: Standard, Free, P10Premium, P20Premium.

property state

state?: pulumi.Input<string>;

Sets Job Collection’s state. Possible values include: Enabled, Disabled, Suspended.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface JobCollectionState

Input properties used for looking up and filtering JobCollection resources.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Scheduler Job Collection. Changing this forces a new resource to be created.

property quota

quota?: pulumi.Input<{
    maxJobCount: pulumi.Input<number>;
    maxRecurrenceFrequency: pulumi.Input<string>;
    maxRecurrenceInterval: pulumi.Input<number>;
    maxRetryInterval: pulumi.Input<number>;
}>;

Configures the Job collection quotas as documented in the quota block below.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Scheduler Job Collection. Changing this forces a new resource to be created.

property sku

sku?: pulumi.Input<string>;

Sets the Job Collection’s pricing level’s SKU. Possible values include: Standard, Free, P10Premium, P20Premium.

property state

state?: pulumi.Input<string>;

Sets Job Collection’s state. Possible values include: Enabled, Disabled, Suspended.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface JobState

Input properties used for looking up and filtering Job resources.

property actionStorageQueue

actionStorageQueue?: pulumi.Input<{
    message: pulumi.Input<string>;
    sasToken: pulumi.Input<string>;
    storageAccountName: pulumi.Input<string>;
    storageQueueName: pulumi.Input<string>;
}>;

A actionStorageQueue block defining a storage queue job action as described below. Note this is identical to an errorActionStorageQueue block.

property actionWeb

actionWeb?: pulumi.Input<{
    authenticationActiveDirectory: pulumi.Input<{
        audience: pulumi.Input<string>;
        clientId: pulumi.Input<string>;
        secret: pulumi.Input<string>;
        tenantId: pulumi.Input<string>;
    }>;
    authenticationBasic: pulumi.Input<{
        password: pulumi.Input<string>;
        username: pulumi.Input<string>;
    }>;
    authenticationCertificate: pulumi.Input<{
        expiration: pulumi.Input<string>;
        password: pulumi.Input<string>;
        pfx: pulumi.Input<string>;
        subjectName: pulumi.Input<string>;
        thumbprint: pulumi.Input<string>;
    }>;
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: any}>;
    method: pulumi.Input<string>;
    url: pulumi.Input<string>;
}>;

A actionWeb block defining the job action as described below. Note this is identical to an errorActionWeb block.

property errorActionStorageQueue

errorActionStorageQueue?: pulumi.Input<{
    message: pulumi.Input<string>;
    sasToken: pulumi.Input<string>;
    storageAccountName: pulumi.Input<string>;
    storageQueueName: pulumi.Input<string>;
}>;

A errorActionStorageQueue block defining the a web action to take on an error as described below. Note this is identical to an actionStorageQueue block.

property errorActionWeb

errorActionWeb?: pulumi.Input<{
    authenticationActiveDirectory: pulumi.Input<{
        audience: pulumi.Input<string>;
        clientId: pulumi.Input<string>;
        secret: pulumi.Input<string>;
        tenantId: pulumi.Input<string>;
    }>;
    authenticationBasic: pulumi.Input<{
        password: pulumi.Input<string>;
        username: pulumi.Input<string>;
    }>;
    authenticationCertificate: pulumi.Input<{
        expiration: pulumi.Input<string>;
        password: pulumi.Input<string>;
        pfx: pulumi.Input<string>;
        subjectName: pulumi.Input<string>;
        thumbprint: pulumi.Input<string>;
    }>;
    body: pulumi.Input<string>;
    headers: pulumi.Input<{[key: string]: any}>;
    method: pulumi.Input<string>;
    url: pulumi.Input<string>;
}>;

A errorActionWeb block defining the action to take on an error as described below. Note this is identical to an actionWeb block.

property jobCollectionName

jobCollectionName?: pulumi.Input<string>;

Specifies the name of the Scheduler Job Collection in which the Job should exist. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the Scheduler Job. Changing this forces a new resource to be created.

property recurrence

recurrence?: pulumi.Input<{
    count: pulumi.Input<number>;
    endTime: pulumi.Input<string>;
    frequency: pulumi.Input<string>;
    hours: pulumi.Input<pulumi.Input<number>[]>;
    interval: pulumi.Input<number>;
    minutes: pulumi.Input<pulumi.Input<number>[]>;
    monthDays: pulumi.Input<pulumi.Input<number>[]>;
    monthlyOccurrences: pulumi.Input<pulumi.Input<{
        day: pulumi.Input<string>;
        occurrence: pulumi.Input<number>;
    }>[]>;
    weekDays: pulumi.Input<pulumi.Input<string>[]>;
}>;

A recurrence block defining a job occurrence schedule.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Scheduler Job. Changing this forces a new resource to be created.

property retry

retry?: pulumi.Input<{
    count: pulumi.Input<number>;
    interval: pulumi.Input<string>;
}>;

A retry block defining how to retry as described below.

property startTime

startTime?: pulumi.Input<string>;

The time the first instance of the job is to start running at.

property state

state?: pulumi.Input<string>;

The sets or gets the current state of the job. Can be set to either Enabled or Completed