【问题标题】:Not able to add webhook subscription to the Azure Event Grid无法将 webhook 订阅添加到 Azure 事件网格
【发布时间】:2018-10-10 16:40:47
【问题描述】:

我无法在 Azure 事件网格中添加新的 WebHook 订阅。有人可以帮忙吗?添加 webhook 端点时出现以下错误。

{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "Url validation",
        "message": "The attempt to validate the provided endpoint https://webapplication120180427035159.azurewebsites.net/api/values?id=AMif5RXS+Bs0bgsbHnNP8RUcn8ZacH8ETUzHXZ5YlNM= failed. For more details, visit https://aka.ms/esvalidation."
      }
    ]
  }

【问题讨论】:

    标签: azure webhooks azure-eventgrid


    【解决方案1】:

    向 Azure 事件网格注册 webhook 时,您的代码必须处理 validation call。您可以关注this sample,展示如何接收验证码并回复以确保订阅者已正确注册。

    目前,这是通过处理所有常规(非验证)事件的代码执行验证的唯一方法。

    如果您使用的是 Azure Functions,则可以使用 EventGridTrigger 而不是 HttpTrigger。它将处理validation handshake,让您让您的函数只专注于“正常”事件。

    【讨论】:

    • 谢谢。这当然有帮助。
    猜你喜欢
    • 2021-12-01
    • 2021-12-14
    • 2020-04-24
    • 2018-03-18
    • 2018-10-14
    • 1970-01-01
    • 2016-07-28
    • 2019-08-05
    • 2018-12-12
    相关资源
    最近更新 更多