Azure-sdk-for-net: EventGrid: The attempt to validate the provided endpoint failed

Created on 4 Sep 2018  路  8Comments  路  Source: Azure/azure-sdk-for-net

I'm trying to create EventGridSubscription for Azure Function that uses _EventGridTrigger_. When running _New-AzureRmEventGridSubscription_ cmdlet i see the following error:

Url validation: The attempt to validate the provided endpoint https://BlobCreatedHandler.azurewebsites.net/admin/EventGridExtensionConfig failed.

Here is my azure function code:

[FunctionName("BlobCreatedHandler")]
public static async Task Run([EventGridTrigger]JObject blobEvent,
[Queue("blob-created-queue", Connection = Strings.StorageAccountConnection)] CloudQueue blobCreatedQueue,
[Inject(typeof(IBlobCreatedHandler))] IBlobCreatedHandler blobCreatedHandler)
{
await blobCreatedHandler.Handle(blobEvent, blobCreatedQueue);
}

I tried different versions of AzureRM.EventGrid module. Interesting thing that on versions lower than 0.3.0 it works fine. But all recent versions starting from 0.3.1 are failing with this error

Event Grid Service Attention bug

Most helpful comment

I eventually got to the bottom of this. It was because the webhook endpoint contains an & character which needed to be escaped to ^^^&

All 8 comments

I'm seeing the same error (The attempt to validate the provided endpoint https://myfuncapp.azurewebsites.net/runtime/webhooks/EventGrid failed.) trying to register an Azure Function with the Azure Functions CLI using az eventgrid event-subscription create

I know that the endpoint URL I'm providing is correct, as I've been able to use Postman to send it a validation request and get the validationCode echoed back to me.

I'm also able to use the portal tooling to create the subscription successfully, but I can't automate it

I'm seeing the same error (The attempt to validate the provided endpoint https://myfuncapp.azurewebsites.net/runtime/webhooks/EventGrid failed.) trying to register an Azure Function with the Azure Functions CLI using az eventgrid event-subscription create

I know that the endpoint URL I'm providing is correct, as I've been able to use Postman to send it a validation request and get the validationCode echoed back to me.

I'm also able to use the portal tooling to create the subscription successfully, but I can't automate it

Mark, i was able to resolve this by adding "extensions" in between "admin" and "EventGridExtensionConfig". Like that:
https://$FunctionAppName.azurewebsites.net/admin/extensions/EventGridExtensionConfig?functionName=BlobCreatedHandler&code=$systemKey

Thanks Sergey, but unfortunately that is the path for v1 of Azure Functions. My function app is v2 which according to the docs expects /runtime/webhooks/EventGrid

And I can call this URL with Postman and manually simulate a validation request, so I'm pretty sure I've got the endpoint address right.

I eventually got to the bottom of this. It was because the webhook endpoint contains an & character which needed to be escaped to ^^^&

@markheath and @sergey1209 . Can you please confirm if this issue is resolved for you by now? thanks

I can work around it with the escaping I mentioned above

@Sergey1209, would you please confirm if your issue is different and requires further attention?

@markheath, good to hear that. Thanks.

I was able to workaround it either

Was this page helpful?
0 / 5 - 0 ratings