Azure Automation Runbook

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

azurerm_automation_runbook (Terraform)

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

Example Usage from GitHub

automation-account.tf#L48
resource "azurerm_automation_runbook" "module_update" {
  name                           = "rb-update-modules"
  location                       = local.REGION
  resource_group_name            = "rg-automation"
  automation_account_name        = azurerm_automation_account.automation.name
  log_verbose                    = "true"
AutomationAccount.tf#L8
resource "azurerm_automation_runbook" "StartVM" {
  name                    = "StartVM1"
  location                = azurerm_resource_group.RG.location
  resource_group_name     = azurerm_resource_group.RG.name
  automation_account_name = azurerm_automation_account.AR_Auto.name
  log_verbose             = "true"
rg-central-us-runbooks.tf#L94
resource "azurerm_automation_runbook" "tmp_rg_cleanup" {
  name                    = "tmp_rg_cleanup"
  location                = azurerm_automation_account.resource-monitor.location
  resource_group_name     = azurerm_automation_account.resource-monitor.resource_group_name
  automation_account_name = azurerm_automation_account.resource-monitor.name
  log_verbose             = "false"
main.tf#L50
resource "azurerm_automation_runbook" "scaleout" {
    depends_on = [azurerm_template_deployment.logicapp-sapregister]
    name = "SAPScaleOut"
    location = var.location
    resource_group_name = data.azurerm_resource_group.scaling-rg.name
    automation_account_name = azurerm_automation_account.scalingaccount.name
main.tf#L50
resource "azurerm_automation_runbook" "scaleout" {
    depends_on = [azurerm_template_deployment.logicapp-sapregister]
    name = "SAPScaleOut"
    location = var.location
    resource_group_name = data.azurerm_resource_group.scaling-rg.name
    automation_account_name = azurerm_automation_account.scalingaccount.name
resource.tf#L1
resource "azurerm_automation_runbook" "aar" {
  name                = var.res_aar_name
  location            = var.res_location
  resource_group_name = var.res_aar_rg_name
  account_name        = var.res_aa_name
  log_verbose         = var.res_aar_log_verbose
runbook.tf#L1
resource "azurerm_automation_runbook" "togglevmpower" {
  name                    = "Toggle_VM_Power_State"
  location                = data.azurerm_resource_group.autorg.location
  resource_group_name     = data.azurerm_resource_group.autorg.name
  automation_account_name = data.azurerm_automation_account.autoacct.name
  log_verbose             = "true"
runbook.tf#L1
resource "azurerm_automation_runbook" "tagging_remediation" {
  name                    = "TaggingRemediation"
  location                = data.azurerm_resource_group.main.location
  resource_group_name     = data.azurerm_resource_group.main.name
  automation_account_name = data.azurerm_automation_account.main.name
  log_verbose             = "true"
main.tf#L7
resource "azurerm_automation_runbook" "this" {
  automation_account_name = var.automation_account_name
  content                 = var.content
  description             = var.description
  location                = var.location
  log_progress            = var.log_progress
main.tf#L7
resource "azurerm_automation_runbook" "this" {
  automation_account_name = var.automation_account_name
  content                 = var.content
  description             = var.description
  location                = var.location
  log_progress            = var.log_progress

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

Manages a Automation Runbook.

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

The automationAccounts/runbooks in Microsoft.Automation can be configured in Azure Resource Manager with the resource name Microsoft.Automation/automationAccounts/runbooks. 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 Runbook?

Azure Automation Runbook 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 Runbook?

For Terraform, the nocticdr/azure-terraform-modules, ashutosh-rathore/AR_LAB1 and mozilla-platform-ops/relops_infra_as_code source code examples are useful. See the Terraform Example section for further details.