Azure Automation Account

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

azurerm_automation_account (Terraform)

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

Example Usage from GitHub

automation_account_test.tf#L10
resource "azurerm_automation_account" "default" {
  name                = "automationAccount1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku_name = "Basic"
main.tf#L1
resource "azurerm_automation_account" "azautomationaccount" {
  name                = var.azAutomationAccountName
  location            = var.location
  resource_group_name = var.rg
  sku_name = var.sku
automation_account.tf#L16
resource "azurerm_automation_account" aa {
  name                        = var.name
  location                    = var.location
  resource_group_name         = var.resource_group_name

  sku {
resource.tf#L1
resource "azurerm_automation_account" "aa" {
  name                = var.res_aa_name
  location            = var.res_location
  resource_group_name = var.res_rg_name
  sku_name            = var.res_aa_sku_name
  tags                = var.res_tags
autoaccount.tf#L5
resource "azurerm_automation_account" "example" {
    name                = var.autoaccount_name
    resource_group_name = var.rg_name
    location            = var.rg_location
    tags                = var.rg_tags
    sku_name            = var.autoaccount_sku_name
automationaccount.tf#L1
resource "azurerm_automation_account" "automationaccount" {
  name                = var.automationaccount.name
  location            = var.location
  resource_group_name = azurerm_resource_group.automationaccount.name

  sku_name = "Basic"
main.tf#L1
resource "azurerm_automation_account" "this" {
  name                = var.name
  resource_group_name = var.resource_group_name
  location            = var.location
  sku_name            = var.sku_name

automation-account.tf#L1
resource "azurerm_automation_account" "automation_account" {
  name                = var.name
  location            = var.location
  resource_group_name = var.resource_group_name


main.tf#L12
resource "azurerm_automation_account" "cmp" {
  name                = var.AutomationAccountName
  location            = azurerm_resource_group.cmp.location
  resource_group_name = azurerm_resource_group.cmp.name

  sku_name = "Basic"
automation_account_test.tf#L10
resource "azurerm_automation_account" "default" {
  name                = "automationAccount1"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  sku_name = "Basic"

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 Account.

Microsoft.Automation/automationAccounts (Azure Resource Manager)

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

Example Usage from GitHub

MHTestEnv.json#L13
      "type": "Microsoft.Automation/automationAccounts",
      "apiVersion": "2015-10-31",
      "name": "[parameters('automationAccounts_MHAutomation_name')]",
      "location": "westeurope",
      "properties": {}
    },
MH_RunBook.json#L13
      "type": "Microsoft.Automation/automationAccounts",
      "apiVersion": "2015-10-31",
      "name": "[parameters('automationAccounts_MHRBook1_name')]",
      "location": "westeurope",
      "properties": {}
    },
omsAutomationAccount-free.json#L57
            "type": "Microsoft.Automation/automationAccounts",
            "apiVersion": "[variables('apiVersions').automation]",
            "location": "[parameters('region')]",
            "dependsOn": [],
            "tags": {},
            "properties": {
Hub-AA.json#L18
            "type": "Microsoft.Automation/automationAccounts",
            "apiVersion": "2015-10-31",
            "name": "[parameters('hubAaName')]",
            "location": "[parameters('location')]",
            "properties": {
                "sku": {
omsAutomationAccount.json#L41
            "type": "Microsoft.Automation/automationAccounts",
            "apiVersion": "2015-01-01-preview",
            "location": "[resourceGroup().location]",
            "dependsOn": [],
            "tags": {},
            "properties": {
main.json#L17
      "type": "Microsoft.Automation/automationAccounts",
      "apiVersion": "2020-01-13-preview",
      "name": "[parameters('AutomationAccountName')]",
      "location": "[parameters('location')]",
      "properties": {
        "sku": {
exported-template.json#L17
            "type": "Microsoft.Automation/automationAccounts",
            "apiVersion": "2015-10-31",
            "name": "[parameters('automationAccounts_CleaningTools_name')]",
            "location": "japaneast",
            "properties": {
                "sku": {
azuredeploy.json#L195
      "type": "Microsoft.Automation/automationAccounts",
      "apiVersion": "2015-01-01-preview",
      "location": "[resourceGroup().location]",
      "dependsOn": [ ],
      "tags": { },
      "properties": {
omsAutomationAccount-free.json#L57
            "type": "Microsoft.Automation/automationAccounts",
            "apiVersion": "[variables('apiVersions').automation]",
            "location": "[parameters('region')]",
            "dependsOn": [],
            "tags": {},
            "properties": {
armTemplateAutoScaleVMSSRunbook.json
{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "AutomationAccount": {

Parameters

  • apiVersion required - string
  • identity optional
      • type optional - string

        The identity type.

      • userAssignedIdentities optional - undefined

        The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

  • location optional - string

    Gets or sets the location of the resource.

  • name required - string

    The name of the automation account.

  • properties required
      • disableLocalAuth optional - boolean

        Indicates whether requests using non-AAD authentication are blocked

      • encryption optional
          • identity optional
              • userAssignedIdentity optional - object

                The user identity used for CMK. It will be an ARM resource id in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

          • keySource optional - string

            Encryption Key Source.

          • keyVaultProperties optional
              • keyName optional - string

                The name of key used to encrypt data.

              • keyvaultUri optional - string

                The URI of the key vault key used to encrypt data.

              • keyVersion optional - string

                The key version of the key used to encrypt data.

      • publicNetworkAccess optional - boolean

        Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet

      • sku optional
          • capacity optional - integer

            Gets or sets the SKU capacity.

          • family optional - string

            Gets or sets the SKU family.

          • name required - string

            Gets or sets the SKU name of the account.

  • tags optional - string

    Gets or sets the tags attached to the resource.

  • type required - string

Frequently asked questions

What is Azure Automation Account?

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

For Terraform, the gilyas/infracost, vkarki/nginxdemo and janegilring/Presentations source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the MilanHochmann/GitARM, MilanHochmann/GitARM and heartland1976/SmallBusinessServerV2 source code examples are useful. See the Azure Resource Manager Example section for further details.