1. Packages
  2. Azure Classic
  3. API Docs
  4. automation
  5. JobSchedule

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

azure.automation.JobSchedule

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi

    Links an Automation Runbook and Schedule.

    Example Usage

    This is an example of just the Job Schedule.

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.automation.JobSchedule("example", {
        resourceGroupName: "tf-rgr-automation",
        automationAccountName: "tf-automation-account",
        scheduleName: "hour",
        runbookName: "Get-VirtualMachine",
        parameters: {
            resourcegroup: "tf-rgr-vm",
            vmname: "TF-VM-01",
        },
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.automation.JobSchedule("example",
        resource_group_name="tf-rgr-automation",
        automation_account_name="tf-automation-account",
        schedule_name="hour",
        runbook_name="Get-VirtualMachine",
        parameters={
            "resourcegroup": "tf-rgr-vm",
            "vmname": "TF-VM-01",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/automation"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := automation.NewJobSchedule(ctx, "example", &automation.JobScheduleArgs{
    			ResourceGroupName:     pulumi.String("tf-rgr-automation"),
    			AutomationAccountName: pulumi.String("tf-automation-account"),
    			ScheduleName:          pulumi.String("hour"),
    			RunbookName:           pulumi.String("Get-VirtualMachine"),
    			Parameters: pulumi.StringMap{
    				"resourcegroup": pulumi.String("tf-rgr-vm"),
    				"vmname":        pulumi.String("TF-VM-01"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Automation.JobSchedule("example", new()
        {
            ResourceGroupName = "tf-rgr-automation",
            AutomationAccountName = "tf-automation-account",
            ScheduleName = "hour",
            RunbookName = "Get-VirtualMachine",
            Parameters = 
            {
                { "resourcegroup", "tf-rgr-vm" },
                { "vmname", "TF-VM-01" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.automation.JobSchedule;
    import com.pulumi.azure.automation.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 example = new JobSchedule("example", JobScheduleArgs.builder()        
                .resourceGroupName("tf-rgr-automation")
                .automationAccountName("tf-automation-account")
                .scheduleName("hour")
                .runbookName("Get-VirtualMachine")
                .parameters(Map.ofEntries(
                    Map.entry("resourcegroup", "tf-rgr-vm"),
                    Map.entry("vmname", "TF-VM-01")
                ))
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:automation:JobSchedule
        properties:
          resourceGroupName: tf-rgr-automation
          automationAccountName: tf-automation-account
          scheduleName: hour
          runbookName: Get-VirtualMachine
          parameters:
            resourcegroup: tf-rgr-vm
            vmname: TF-VM-01
    

    Create JobSchedule Resource

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

    Constructor syntax

    new JobSchedule(name: string, args: JobScheduleArgs, opts?: CustomResourceOptions);
    @overload
    def JobSchedule(resource_name: str,
                    args: JobScheduleArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def JobSchedule(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    automation_account_name: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    runbook_name: Optional[str] = None,
                    schedule_name: Optional[str] = None,
                    job_schedule_id: Optional[str] = None,
                    parameters: Optional[Mapping[str, str]] = None,
                    run_on: Optional[str] = None)
    func NewJobSchedule(ctx *Context, name string, args JobScheduleArgs, opts ...ResourceOption) (*JobSchedule, error)
    public JobSchedule(string name, JobScheduleArgs args, CustomResourceOptions? opts = null)
    public JobSchedule(String name, JobScheduleArgs args)
    public JobSchedule(String name, JobScheduleArgs args, CustomResourceOptions options)
    
    type: azure:automation:JobSchedule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Example

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

    var jobScheduleResource = new Azure.Automation.JobSchedule("jobScheduleResource", new()
    {
        AutomationAccountName = "string",
        ResourceGroupName = "string",
        RunbookName = "string",
        ScheduleName = "string",
        JobScheduleId = "string",
        Parameters = 
        {
            { "string", "string" },
        },
        RunOn = "string",
    });
    
    example, err := automation.NewJobSchedule(ctx, "jobScheduleResource", &automation.JobScheduleArgs{
    	AutomationAccountName: pulumi.String("string"),
    	ResourceGroupName:     pulumi.String("string"),
    	RunbookName:           pulumi.String("string"),
    	ScheduleName:          pulumi.String("string"),
    	JobScheduleId:         pulumi.String("string"),
    	Parameters: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	RunOn: pulumi.String("string"),
    })
    
    var jobScheduleResource = new JobSchedule("jobScheduleResource", JobScheduleArgs.builder()        
        .automationAccountName("string")
        .resourceGroupName("string")
        .runbookName("string")
        .scheduleName("string")
        .jobScheduleId("string")
        .parameters(Map.of("string", "string"))
        .runOn("string")
        .build());
    
    job_schedule_resource = azure.automation.JobSchedule("jobScheduleResource",
        automation_account_name="string",
        resource_group_name="string",
        runbook_name="string",
        schedule_name="string",
        job_schedule_id="string",
        parameters={
            "string": "string",
        },
        run_on="string")
    
    const jobScheduleResource = new azure.automation.JobSchedule("jobScheduleResource", {
        automationAccountName: "string",
        resourceGroupName: "string",
        runbookName: "string",
        scheduleName: "string",
        jobScheduleId: "string",
        parameters: {
            string: "string",
        },
        runOn: "string",
    });
    
    type: azure:automation:JobSchedule
    properties:
        automationAccountName: string
        jobScheduleId: string
        parameters:
            string: string
        resourceGroupName: string
        runOn: string
        runbookName: string
        scheduleName: string
    

    JobSchedule Resource Properties

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

    Inputs

    The JobSchedule resource accepts the following input properties:

    AutomationAccountName string
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    RunbookName string
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    ScheduleName string
    The name of the Schedule. Changing this forces a new resource to be created.
    JobScheduleId string
    (Optional) The UUID identifying the Automation Job Schedule.
    Parameters Dictionary<string, string>

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    RunOn string
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    AutomationAccountName string
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    RunbookName string
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    ScheduleName string
    The name of the Schedule. Changing this forces a new resource to be created.
    JobScheduleId string
    (Optional) The UUID identifying the Automation Job Schedule.
    Parameters map[string]string

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    RunOn string
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    automationAccountName String
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runbookName String
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    scheduleName String
    The name of the Schedule. Changing this forces a new resource to be created.
    jobScheduleId String
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters Map<String,String>

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    runOn String
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    automationAccountName string
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runbookName string
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    scheduleName string
    The name of the Schedule. Changing this forces a new resource to be created.
    jobScheduleId string
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters {[key: string]: string}

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    runOn string
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    automation_account_name str
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runbook_name str
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    schedule_name str
    The name of the Schedule. Changing this forces a new resource to be created.
    job_schedule_id str
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters Mapping[str, str]

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    run_on str
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    automationAccountName String
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runbookName String
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    scheduleName String
    The name of the Schedule. Changing this forces a new resource to be created.
    jobScheduleId String
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters Map<String>

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    runOn String
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the JobSchedule 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 JobSchedule Resource

    Get an existing JobSchedule 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?: JobScheduleState, opts?: CustomResourceOptions): JobSchedule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            automation_account_name: Optional[str] = None,
            job_schedule_id: Optional[str] = None,
            parameters: Optional[Mapping[str, str]] = None,
            resource_group_name: Optional[str] = None,
            run_on: Optional[str] = None,
            runbook_name: Optional[str] = None,
            schedule_name: Optional[str] = None) -> JobSchedule
    func GetJobSchedule(ctx *Context, name string, id IDInput, state *JobScheduleState, opts ...ResourceOption) (*JobSchedule, error)
    public static JobSchedule Get(string name, Input<string> id, JobScheduleState? state, CustomResourceOptions? opts = null)
    public static JobSchedule get(String name, Output<String> id, JobScheduleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    AutomationAccountName string
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    JobScheduleId string
    (Optional) The UUID identifying the Automation Job Schedule.
    Parameters Dictionary<string, string>

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    ResourceGroupName string
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    RunOn string
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    RunbookName string
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    ScheduleName string
    The name of the Schedule. Changing this forces a new resource to be created.
    AutomationAccountName string
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    JobScheduleId string
    (Optional) The UUID identifying the Automation Job Schedule.
    Parameters map[string]string

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    ResourceGroupName string
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    RunOn string
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    RunbookName string
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    ScheduleName string
    The name of the Schedule. Changing this forces a new resource to be created.
    automationAccountName String
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    jobScheduleId String
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters Map<String,String>

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    resourceGroupName String
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runOn String
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    runbookName String
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    scheduleName String
    The name of the Schedule. Changing this forces a new resource to be created.
    automationAccountName string
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    jobScheduleId string
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters {[key: string]: string}

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    resourceGroupName string
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runOn string
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    runbookName string
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    scheduleName string
    The name of the Schedule. Changing this forces a new resource to be created.
    automation_account_name str
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    job_schedule_id str
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters Mapping[str, str]

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    resource_group_name str
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    run_on str
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    runbook_name str
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    schedule_name str
    The name of the Schedule. Changing this forces a new resource to be created.
    automationAccountName String
    The name of the Automation Account in which the Job Schedule is created. Changing this forces a new resource to be created.
    jobScheduleId String
    (Optional) The UUID identifying the Automation Job Schedule.
    parameters Map<String>

    A map of key/value pairs corresponding to the arguments that can be passed to the Runbook. Changing this forces a new resource to be created.

    NOTE: The parameter keys/names must strictly be in lowercase, even if this is not the case in the runbook. This is due to a limitation in Azure Automation where the parameter names are normalized. The values specified don't have this limitation.

    resourceGroupName String
    The name of the resource group in which the Job Schedule is created. Changing this forces a new resource to be created.
    runOn String
    Name of a Hybrid Worker Group the Runbook will be executed on. Changing this forces a new resource to be created.
    runbookName String
    The name of a Runbook to link to a Schedule. It needs to be in the same Automation Account as the Schedule and Job Schedule. Changing this forces a new resource to be created.
    scheduleName String
    The name of the Schedule. Changing this forces a new resource to be created.

    Import

    Automation Job Schedules can be imported using the resource id, e.g.

    $ pulumi import azure:automation/jobSchedule:JobSchedule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/jobSchedules/10000000-1001-1001-1001-000000000001
    

    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.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.72.0 published on Monday, Apr 15, 2024 by Pulumi