Search code examples
azureazure-resource-managerazure-resource-groupazure-rm-template

ARM template for adding runbooks and modules


Currently I am uploading manually custom modules for azure runtime automation runbooks in the azure portal. Then I also create manually a runbook which executes my custom module. I would like to do this via an ARM script.

I assume everything you can do in the azure portal, is also possible in ARM.

I am new to ARM, but deployed a website through ARM. That was relatively easy as I could just select Web App as resource. But in the Add Resource list, I can't find anything related to runbook or modules. Where can I find templates for this?


Solution

  • It is possible. You could check this link: Deploy Custom Azure Automation Integration Modules Using ARM Templates.

    {
      "$schema": "http://schemas.microsoft.org/azure/deploymentTemplate?api-version=2015-01-01-preview#",
      "contentVersion": "1.0",
      "parameters": {
        "automationAccountType": {
          "type": "string",
          "allowedValues": [
            "New",
            "Existing"
          ]
        },
        "automationAccountName": {
          "type": "string"
        },
        "moduleName": {
          "type": "string"
        },
        "moduleUri":{
          "type": "string"  
        }
      },
      "variables": {
        "templatelink": "[concat('https://raw.githubusercontent.com/rchaganti/armseries/master/', parameters('automationAccountType'), 'AccountTemplate.json')]"
      },
      "resources": [
        {
          "apiVersion": "2015-01-01",
          "name": "nestedTemplate",
          "type": "Microsoft.Resources/deployments",
          "properties": {
            "mode": "incremental",
            "templateLink": {
              "uri": "[variables('templatelink')]",
              "contentVersion": "1.0"
            },
            "parameters": {
              "accountName": {
                "value": "[parameters('automationAccountName')]"
              },
              "accountLocation": {
                "value": "[resourceGroup().Location]"
              },
              "moduleName": {
                "value": "[parameters('moduleName')]"
              },
              "moduleUri": {
                "value": "[parameters('moduleUri')]"
              }
            }
          }
        }
      ]
    }