简体   繁体   English

无法将Webhook订阅添加到Azure事件网格

[英]Not able to add webhook subscription to the Azure Event Grid

I am not able to add a new WebHook subscription in the Azure Event Grid. 我无法在Azure事件网格中添加新的WebHook订阅。 Can someone help? 有人可以帮忙吗? I am getting below error when I add the webhook endpoint. 添加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." } ] } 

When registering a webhook with Azure Event Grid, your code has to handle validation call . 在Azure事件网格中注册Webhook时,您的代码必须处理验证调用 You can follow this sample showing how to receive validation code and reply back to ensure subscriber is registered properly. 您可以按照此示例显示如何接收验证码并回信以确保订阅者已正确注册。

At the moment, this is the only way to perform validation, via code that handles all regular (non-validation) events. 目前,这是通过处理所有常规(非验证)事件的代码执行验证的唯一方法。

If you are using Azure Functions, you could use EventGridTrigger instead of HttpTrigger . 如果使用的是Azure函数,则可以使用EventGridTrigger而不是HttpTrigger It will handle validation handshake for you leaving your Function to focus on the "normal" events only. 它将为您处理验证握手 ,而让Function仅关注“正常”事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM