用于添加 Runbook 和模块的 ARM 模板

2023-11-29

目前,我正在 azure 门户中手动上传 azure 运行时自动化 Runbook 的自定义模块。然后,我还手动创建一个运行手册来执行我的自定义模块。我想通过 ARM 脚本来完成此操作。

我认为您在 azure 门户中可以做的所有事情在 ARM 中也可以实现。

我是ARM新手,但是通过ARM部署了一个网站。这相对容易,因为我只需选择 Web 应用程序作为资源即可。但在“添加资源”列表中,我找不到与 Runbook 或模块相关的任何内容。我在哪里可以找到这方面的模板?


有可能的。你可以检查这个链接:使用 ARM 模板部署自定义 Azure 自动化集成模块.

{
  "$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')]"
          }
        }
      }
    }
  ]
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

用于添加 Runbook 和模块的 ARM 模板 的相关文章

随机推荐