ARM template for adding runbooks and modules

别来无恙 提交于 2019-12-01 07:34:21

问题


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?


回答1:


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')]"
          }
        }
      }
    }
  ]
}


来源:https://stackoverflow.com/questions/43996904/arm-template-for-adding-runbooks-and-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!