Francis
Francis

Reputation: 488

Azure RM Template resourceId() for webhooks

I want to create actionGroups via ARM template. And I did not find how to reference 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')]" return an error!

Upvotes: 0

Views: 146

Answers (1)

4c74356b41
4c74356b41

Reputation: 72181

right, because you'd have to use resourceId() like so:

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

Reading: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-template-functions-resource#resourceid

Upvotes: 3

Related Questions