Webhooks的Azure RM模板resourceId()

时间:2019-08-14 19:04:43

标签: azure azure-resource-manager arm-template

我想通过ARM模板创建actionGroups。而且我没有找到如何引用webhookResourceId。

{
     "apiVersion": "2019-06-01",
     "type": "microsoft.insights/actionGroups",
     "location": "Global",
     "name": "[variables('ActionGroupCallRunBook')]",
     "properties": {
        "enabled": true,
        "automationRunbookReceivers": [
           {
              "name": "[concat('webhook-',variables('ActionGroupCallRunBook'))]",
              "automationAccountId": "[resourceId('microsoft.insights/components', parameters('AzureTelemetryName'))]",
              "runbookName": "myRunbook",
              "webhookResourceId": "[resourceId('Microsoft.Automation/automationAccounts/webhooks'), parameters('WebHookOnRunBookName')]",
              "isGlobalRunbook": false,
              "useCommonAlertSchema": false
           }
        ]
     },
     "tags": {
        "displayName": "ActionGroupCallRunBook"
     }
  }

“ webhookResourceId”:“ [resourceId('Microsoft.Automation / automationAccounts / webhooks'),parameters('WebHookOnRunBookName')]”返回错误!

1 个答案:

答案 0 :(得分:2)

对,因为您必须像这样使用resourceId()

resourceId('Microsoft.Automation/automationAccounts/webhooks', 'automationaccountname`, 'webhookname`)

阅读:https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#resourceid