Microsoft.Automation automationAccounts/runbooks 2022-08-08

Bicep resource definition

The automationAccounts/runbooks resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Automation/automationAccounts/runbooks resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Automation/automationAccounts/runbooks@2022-08-08' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    description: 'string'
    draft: {
      creationTime: 'string'
      draftContentLink: {
        contentHash: {
          algorithm: 'string'
          value: 'string'
        }
        uri: 'string'
        version: 'string'
      }
      inEdit: bool
      lastModifiedTime: 'string'
      outputTypes: [
        'string'
      ]
      parameters: {
        {customized property}: {
          defaultValue: 'string'
          isMandatory: bool
          position: int
          type: 'string'
        }
      }
    }
    logActivityTrace: int
    logProgress: bool
    logVerbose: bool
    publishContentLink: {
      contentHash: {
        algorithm: 'string'
        value: 'string'
      }
      uri: 'string'
      version: 'string'
    }
    runbookType: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

Property values

ContentHash

Name Description Value
algorithm Gets or sets the content hash algorithm used to hash the content. string (required)
value Gets or sets expected hash value of the content. string (required)
Name Description Value
contentHash Gets or sets the hash. ContentHash
uri Gets or sets the uri of the runbook content. string
version Gets or sets the version of the content. string

Microsoft.Automation/automationAccounts/runbooks

Name Description Value
location Gets or sets the location of the resource. string
name The resource name string

Constraints:
Pattern = ^[a-zA-Z][a-zA-Z-_0-9]*$ (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: automationAccounts
properties Gets or sets runbook create or update properties. RunbookCreateOrUpdatePropertiesOrRunbookProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates

RunbookCreateOrUpdateParametersTags

Name Description Value

RunbookCreateOrUpdatePropertiesOrRunbookProperties

Name Description Value
description Gets or sets the description of the runbook. string
draft Gets or sets the draft runbook properties. RunbookDraft
logActivityTrace Gets or sets the activity-level tracing options of the runbook. int
logProgress Gets or sets progress log option. bool
logVerbose Gets or sets verbose log option. bool
publishContentLink Gets or sets the published runbook content link. ContentLink
runbookType Gets or sets the type of the runbook. 'Graph'
'GraphPowerShell'
'GraphPowerShellWorkflow'
'PowerShell'
'PowerShellWorkflow'
'Python2'
'Python3'
'Script' (required)

RunbookDraft

Name Description Value
creationTime Gets or sets the creation time of the runbook draft. string
draftContentLink Gets or sets the draft runbook content link. ContentLink
inEdit Gets or sets whether runbook is in edit mode. bool
lastModifiedTime Gets or sets the last modified time of the runbook draft. string
outputTypes Gets or sets the runbook output types. string[]
parameters Gets or sets the runbook draft parameters. RunbookDraftParameters

RunbookDraftParameters

Name Description Value

RunbookParameter

Name Description Value
defaultValue Gets or sets the default value of parameter. string
isMandatory Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. bool
position Get or sets the position of the parameter. int
type Gets or sets the type of the parameter. string

Quickstart samples

The following quickstart samples deploy this resource type.

Bicep File Description
ASR Runbooks Deploys Automation Runbooks for ASR Recovery Plans

ARM template resource definition

The automationAccounts/runbooks resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Automation/automationAccounts/runbooks resource, add the following JSON to your template.

{
  "type": "Microsoft.Automation/automationAccounts/runbooks",
  "apiVersion": "2022-08-08",
  "name": "string",
  "location": "string",
  "properties": {
    "description": "string",
    "draft": {
      "creationTime": "string",
      "draftContentLink": {
        "contentHash": {
          "algorithm": "string",
          "value": "string"
        },
        "uri": "string",
        "version": "string"
      },
      "inEdit": "bool",
      "lastModifiedTime": "string",
      "outputTypes": [ "string" ],
      "parameters": {
        "{customized property}": {
          "defaultValue": "string",
          "isMandatory": "bool",
          "position": "int",
          "type": "string"
        }
      }
    },
    "logActivityTrace": "int",
    "logProgress": "bool",
    "logVerbose": "bool",
    "publishContentLink": {
      "contentHash": {
        "algorithm": "string",
        "value": "string"
      },
      "uri": "string",
      "version": "string"
    },
    "runbookType": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property values

ContentHash

Name Description Value
algorithm Gets or sets the content hash algorithm used to hash the content. string (required)
value Gets or sets expected hash value of the content. string (required)
Name Description Value
contentHash Gets or sets the hash. ContentHash
uri Gets or sets the uri of the runbook content. string
version Gets or sets the version of the content. string

Microsoft.Automation/automationAccounts/runbooks

Name Description Value
apiVersion The api version '2022-08-08'
location Gets or sets the location of the resource. string
name The resource name string

Constraints:
Pattern = ^[a-zA-Z][a-zA-Z-_0-9]*$ (required)
properties Gets or sets runbook create or update properties. RunbookCreateOrUpdatePropertiesOrRunbookProperties (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.Automation/automationAccounts/runbooks'

RunbookCreateOrUpdateParametersTags

Name Description Value

RunbookCreateOrUpdatePropertiesOrRunbookProperties

Name Description Value
description Gets or sets the description of the runbook. string
draft Gets or sets the draft runbook properties. RunbookDraft
logActivityTrace Gets or sets the activity-level tracing options of the runbook. int
logProgress Gets or sets progress log option. bool
logVerbose Gets or sets verbose log option. bool
publishContentLink Gets or sets the published runbook content link. ContentLink
runbookType Gets or sets the type of the runbook. 'Graph'
'GraphPowerShell'
'GraphPowerShellWorkflow'
'PowerShell'
'PowerShellWorkflow'
'Python2'
'Python3'
'Script' (required)

RunbookDraft

Name Description Value
creationTime Gets or sets the creation time of the runbook draft. string
draftContentLink Gets or sets the draft runbook content link. ContentLink
inEdit Gets or sets whether runbook is in edit mode. bool
lastModifiedTime Gets or sets the last modified time of the runbook draft. string
outputTypes Gets or sets the runbook output types. string[]
parameters Gets or sets the runbook draft parameters. RunbookDraftParameters

RunbookDraftParameters

Name Description Value

RunbookParameter

Name Description Value
defaultValue Gets or sets the default value of parameter. string
isMandatory Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. bool
position Get or sets the position of the parameter. int
type Gets or sets the type of the parameter. string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
ASR Runbooks

Deploy to Azure
Deploys Automation Runbooks for ASR Recovery Plans
Azure Resource Optimization (ARO) Toolkit

Deploy to Azure
The Azure Resource Optimization Toolkit is a decentralized, native Azure solution using serverless technologies to optimize Azure resources on your subscription. Optimization happens automatically on your subscription once you enable or create your own schedule, including on new resources. This is an Azure Automation account with preconfigured runbooks and schedules you can utilize on your subscription to start saving money.

Terraform (AzAPI provider) resource definition

The automationAccounts/runbooks resource type can be deployed with operations that target:

  • Resource groups

For a list of changed properties in each API version, see change log.

Resource format

To create a Microsoft.Automation/automationAccounts/runbooks resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Automation/automationAccounts/runbooks@2022-08-08"
  name = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = jsonencode({
    properties = {
      description = "string"
      draft = {
        creationTime = "string"
        draftContentLink = {
          contentHash = {
            algorithm = "string"
            value = "string"
          }
          uri = "string"
          version = "string"
        }
        inEdit = bool
        lastModifiedTime = "string"
        outputTypes = [
          "string"
        ]
        parameters = {
          {customized property} = {
            defaultValue = "string"
            isMandatory = bool
            position = int
            type = "string"
          }
        }
      }
      logActivityTrace = int
      logProgress = bool
      logVerbose = bool
      publishContentLink = {
        contentHash = {
          algorithm = "string"
          value = "string"
        }
        uri = "string"
        version = "string"
      }
      runbookType = "string"
    }
  })
}

Property values

ContentHash

Name Description Value
algorithm Gets or sets the content hash algorithm used to hash the content. string (required)
value Gets or sets expected hash value of the content. string (required)
Name Description Value
contentHash Gets or sets the hash. ContentHash
uri Gets or sets the uri of the runbook content. string
version Gets or sets the version of the content. string

Microsoft.Automation/automationAccounts/runbooks

Name Description Value
location Gets or sets the location of the resource. string
name The resource name string

Constraints:
Pattern = ^[a-zA-Z][a-zA-Z-_0-9]*$ (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: automationAccounts
properties Gets or sets runbook create or update properties. RunbookCreateOrUpdatePropertiesOrRunbookProperties (required)
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.Automation/automationAccounts/runbooks@2022-08-08"

RunbookCreateOrUpdateParametersTags

Name Description Value

RunbookCreateOrUpdatePropertiesOrRunbookProperties

Name Description Value
description Gets or sets the description of the runbook. string
draft Gets or sets the draft runbook properties. RunbookDraft
logActivityTrace Gets or sets the activity-level tracing options of the runbook. int
logProgress Gets or sets progress log option. bool
logVerbose Gets or sets verbose log option. bool
publishContentLink Gets or sets the published runbook content link. ContentLink
runbookType Gets or sets the type of the runbook. 'Graph'
'GraphPowerShell'
'GraphPowerShellWorkflow'
'PowerShell'
'PowerShellWorkflow'
'Python2'
'Python3'
'Script' (required)

RunbookDraft

Name Description Value
creationTime Gets or sets the creation time of the runbook draft. string
draftContentLink Gets or sets the draft runbook content link. ContentLink
inEdit Gets or sets whether runbook is in edit mode. bool
lastModifiedTime Gets or sets the last modified time of the runbook draft. string
outputTypes Gets or sets the runbook output types. string[]
parameters Gets or sets the runbook draft parameters. RunbookDraftParameters

RunbookDraftParameters

Name Description Value

RunbookParameter

Name Description Value
defaultValue Gets or sets the default value of parameter. string
isMandatory Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. bool
position Get or sets the position of the parameter. int
type Gets or sets the type of the parameter. string