【问题标题】:Azure RM Template AutomationRunbookServiceUriIsNotValidAzure RM 模板 AutomationRunbookServiceUriIsNotValid
【发布时间】:2019-08-19 13:18:27
【问题描述】:

我需要使用 ARM 模板部署“microsoft.insights/actionGroups”类型的资源,但我遇到了一个问题。我的模板:

{
     "apiVersion": "2019-06-01",
     "type": "microsoft.insights/actionGroups",
     "location": "Global",
     "name": "[variables('ActionGroupName')]",
     "tags": {
        "displayName": "MyActionGroupName"
     },
     "properties": {
        "groupShortName": "variables('ActionGroupShortName')",
        "enabled": true,
        "automationRunbookReceivers": [
           {
              "name": "MyRunbookRecieverName",
              "automationAccountId": "[resourceId('microsoft.insights/components', parameters('AzureTelemetryName'))]",
              "runbookName": "MyRunbook",
              "webhookResourceId": "[resourceId('Microsoft.Automation/automationAccounts/webhooks', parameters('AzureAutomationName'), 'WebHookName')]",
              "isGlobalRunbook": false
           }
        ]
     }
  }

但是当我尝试部署时,我得到了这个错误:

New-AzureRmResourceGroupDeployment : 08:39:52 - 资源 microsoft.insights/actionGroups 'ActionGroupName' 失败并显示消息'{ "代码": "AutomationRunbookServiceUriIsNotValid", “消息”:“AutomationRunbookServiceUriIsNotValid”

我查看template definition,提到WebhookReceiver.identifierUri不是强制性的。

我做错了什么?

【问题讨论】:

  • 你在使用automationRunbookReceivers,为什么你在WebhookReceiver中提到identifierUri?可能应该是serviceUri in automationRunbookReceivers?

标签: azure powershell arm-template azure-rm


【解决方案1】:

我可以用模板重现你的问题,我在automationRunbookReceivers 中添加了serviceUri,然后它就可以正常工作了。你可以参考这个link来创建webhook。

 "automationRunbookReceivers": [
           {
              "name": "MyRunbookRecieverName",
              "automationAccountId": "[resourceId('microsoft.insights/components', parameters('AzureTelemetryName'))]",
              "runbookName": "MyRunbook",
              "webhookResourceId": "[resourceId('Microsoft.Automation/automationAccounts/webhooks', parameters('AzureAutomationName'), 'WebHookName')]",
              "isGlobalRunbook": false,
              "serviceUri":"https://s16events.azure-automation.net/webhooks?token=xxxxxxxxxxxx"
           }
        ]

serviceUri不是必须的问题,我不确定文档是否有错误,只是一些测试结果供您参考。(如果我做错了,请纠正我。)

doc 中,如下所示。 nameNo 必需的,但如果我在没有它的情况下部署,我会收到 AutomationRunbookReceiverNameIsNullOrEmpty 错误。 useCommonAlertSchema 是必需的,但如果我在没有它的情况下进行部署,我将不会收到任何错误。 serviceUri 也会发生同样的事情。

【讨论】:

  • 如果我使用 ARM 模板创建了我的 webhook,如何引用它? Uri 在进程中的任何地方都不可见?
  • P.S.谢谢你的回答很清楚。文档和现实之间似乎有差距。
  • @Francis 是的,创建后url不可见,创建时保存即可。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-07-01
  • 2017-06-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多