Azure Automation Job Schedule

This page shows how to write Terraform and Azure Resource Manager for Automation Job Schedule and write them securely.

azurerm_automation_job_schedule (Terraform)

The Job Schedule in Automation can be configured in Terraform with the resource name azurerm_automation_job_schedule. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

automation_job_schedule_test.tf#L11
resource "azurerm_automation_job_schedule" "zeroMinutes" {
  resource_group_name     = azurerm_resource_group.example.name
  automation_account_name = "tf-automation-account"
  schedule_name           = "hour"
  runbook_name            = "Get-VirtualMachine"
}
schedule.tf#L24
resource "azurerm_automation_job_schedule" "vm_job_startup" {
  resource_group_name     = data.azurerm_resource_group.example.name
  automation_account_name = data.azurerm_automation_account.example.name
  schedule_name           = azurerm_automation_schedule.vmstartup
  runbook_name            = azurerm_automation_runbook.togglevmpower

automation-account.tf#L153
resource "azurerm_automation_job_schedule" "start_vm" {
  resource_group_name     = "rg-automation"
  automation_account_name = azurerm_automation_account.automation.name
  schedule_name           = "MON_FRI_0800"
  runbook_name            = "rb-start-vm"

rg-central-us-runbooks.tf#L110
resource "azurerm_automation_job_schedule" "tmp_rg_cleanup" {
  resource_group_name     = azurerm_automation_account.resource-monitor.resource_group_name
  automation_account_name = azurerm_automation_account.resource-monitor.name
  schedule_name           = azurerm_automation_schedule.every-4-hours.name
  runbook_name            = azurerm_automation_runbook.tmp_rg_cleanup.name
}
automation_job_schedule_test.tf#L11
resource "azurerm_automation_job_schedule" "zeroMinutes" {
  resource_group_name     = azurerm_resource_group.example.name
  automation_account_name = "tf-automation-account"
  schedule_name           = "hour"
  runbook_name            = "Get-VirtualMachine"
}
autojobschedule.tf#L5
resource "azurerm_automation_job_schedule" "example" {
    resource_group_name     = var.rg_name
    automation_account_name = var.autojobschedule_autoaccount_name
    schedule_name           = var.autojobschedule_schedule_name
    runbook_name            = var.autojobschedule_runbook_name
    parameters              = var.autojobschedule_parameters
main.tf#L1
resource "azurerm_automation_job_schedule" "azautomationjobschedule" {
  resource_group_name     = var.rg
  automation_account_name = var.azAutomationAccountName
  schedule_name           = var.azAutomationScheduleName
  runbook_name            = var.azAutomationRunbookName
main.tf#L1
resource "azurerm_automation_job_schedule" "azautomationjobschedule" {
  resource_group_name     = var.rg
  automation_account_name = var.azAutomationAccountName
  schedule_name           = var.azAutomationScheduleName
  runbook_name            = var.azAutomationRunbookName
  parameters = {
resource.tf#L1
resource "azurerm_automation_job_schedule" "aajs" {
  schedule_name           = var.res_aas_name
  resource_group_name     = var.res_aa_rg_name
  automation_account_name = var.res_aa_name
  runbook_name            = var.res_aar_name
  parameters              = var.res_aajs_map_parameters
schedule.tf#L11
resource "azurerm_automation_job_schedule" "tagging_remediation" {
  resource_group_name     = data.azurerm_resource_group.main.name
  automation_account_name = data.azurerm_automation_account.main.name
  schedule_name           = "Every Four Hours"
  runbook_name            = azurerm_automation_runbook.tagging_remediation.name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Links an Automation Runbook and Schedule.

Microsoft.Automation/automationAccounts/jobSchedules (Azure Resource Manager)

The automationAccounts/jobSchedules in Microsoft.Automation can be configured in Azure Resource Manager with the resource name Microsoft.Automation/automationAccounts/jobSchedules. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Frequently asked questions

What is Azure Automation Job Schedule?

Azure Automation Job Schedule is a resource for Automation of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Automation Job Schedule?

For Terraform, the gilyas/infracost, paul-p-cb/azure_automation and nocticdr/azure-terraform-modules source code examples are useful. See the Terraform Example section for further details.