Azure-docs: Following documentation for Webhook, yet still receive "The attempt to validate the provided endpoint"

Created on 30 Mar 2020  Â·  25Comments  Â·  Source: MicrosoftDocs/azure-docs

Created an endpoint in my C# code at /events path. If the event is of type "Microsoft.EventGrid.SubscriptionValidationEvent", i extract the ValidationCode and return 200 with a json object with validationResponse. I tested this using Postman, and everything appears to work, but when using "New-AzEventGridSubscription", it fails. Any ideas?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author event-grisvc product-question triaged

Most helpful comment

@banisadr I ended up putting in a support ticket in Azure. After working with a rep for a few days, it turns out that my API was returned as "Chunked" which wasn't supported. A patch was applied yesterday on Microsoft's end and now it works.

I had a sneaky suspicion that was the issue. Glad to see it's resolved.

@taysco Try again without using the validationUrl!

All 25 comments

Sample input
[
{
"id": "531d4a96-d4c7-43d6-8b4c-e1ff9351b869",
"topic": "scrubbed",
"subject": "",
"data": {
"validationCode": "7062AAC0-656D-4C4C-BDD6-0FA673676D95",
"validationUrl": "scrubbed"
},
"eventType": "Microsoft.EventGrid.SubscriptionValidationEvent",
"eventTime": "2020-03-30T17:46:15.1827678Z",
"metadataVersion": "1",
"dataVersion": "2"
}
]

Sample output
{
"validationResponse": "7062AAC0-656D-4C4C-BDD6-0FA673676D95"
}

@MattHartz Thank you for your feedback! We will review and update as appropriate.

Just checking if you have gone through this.

Powershell sample :

$includedEventTypes = "Microsoft.Resources.ResourceWriteFailure", "Microsoft.Resources.ResourceWriteSuccess"
$labels = "Finance", "HR"
New-AzEventGridSubscription -Endpoint https://requestb.in/19qlscd1 -EventSubscriptionName EventSubscription1 -SubjectBeginsWith "TestPrefix" -SubjectEndsWith "TestSuffix" -IncludedEventType $includedEventTypes -Label $labels

This will creates a new event subscription EventSubscription1 to the currently selected Azure subscription with the webhook destination endpoint https://requestb.in/19qlscd1. This event subscription specifies the additional filters for event types and subject, and only events matching those filters will be delivered to the destination endpoint.

More info is given here https://docs.microsoft.com/en-us/powershell/module/az.eventgrid/new-azeventgridsubscription?view=azps-3.6.1

@DixitArora-MSFT
Yes I used this command
New-AzEventGridSubscription -ResourceGroup MyResourceGroupName -Endpoint https://requestb.in/19qlscd1 -EventSubscriptionName EventSubscription1 -TopicName Topic1

I can send a direct message somewhere w/ my actual endpoint, and my actual command. If that helps investigation.

@banisadr Any inputs on this ?

@DixitArora-MSFT Let me know what i can do to help

@banisadr ?

@MattHartz I have assigned this to content author for further review and update as appropriate.

@banisadr @DixitArora-MSFT I am doing the following

  1. Returning 200
  2. Returning { "validationResponse": "" }
  3. Responding in < 1 second.

What else am i missing from your documentation?

i have exactly the same issue. if i deploy the validation as an azure function, all is dandy./ if i deploy as a web app, it fails.

@lucarv Yeah, i even ran it locally using ngrok, and i can get the validationevent from EG. But then it fails the handshake for whatever reason.

@DixitArora-MSFT

I am encountering the same problem here. I can also confirm that my az func is getting executed so the validation process on your side is connecting, it's just failing somewhere. Any ETA on getting a resolution here? This is impacting our SignalR events.

I figured out a work around in case anyone else is stuck ... if your using the examples, add a console.log(req); and re-run the az eventgrid event-subscription create command ... it'll say Running... and make a post to your endpoint, grab the validationUrl from the console.log output and open that in a browser. This all must be done in 5 minutes or while the az command is saying 'Running...' ... after you hit the validationUrl in the browser, in a few seconds the az command will return succesfully.

@MattHartz it looks like based on your description, you are doing everything correctly to validate the endpoint and we will need more details about your Azure Resources, time of the tests, and endpoint to pull the logs and look into the failure. The easiest way to get that would be if you can please open a support ticket.

In order to unblock you in the meantime, the manual validation flow @taysco mentioned (described here under asynchronous handshake will allow you to manually validate your endpoint.

Alternatively you can also enable diagnostic logs to try to look into the details of the failures further: https://docs.microsoft.com/en-us/azure/event-grid/enable-diagnostic-logs-topic

@banisadr I ended up putting in a support ticket in Azure. After working with a rep for a few days, it turns out that my API was returned as "Chunked" which wasn't supported. A patch was applied yesterday on Microsoft's end and now it works.

I had a sneaky suspicion that was the issue. Glad to see it's resolved.

@taysco Try again without using the validationUrl!

Well thank you @MattHartz for helping us catch that issue and build a better product :)

Hello

You close this issue but it is still broken. Please reopen until properly fixed.

From: Bahram Banisadr notifications@github.com
Date: Friday, 17 April 2020 at 18:45
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: Tayo Carvalhal Tayo.Carvalhal@microsoft.com, Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Following documentation for Webhook, yet still receive "The attempt to validate the provided endpoint" (#51296)

Well thank you @MattHartzhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMattHartz&data=02%7C01%7CTayo.Carvalhal%40microsoft.com%7Cef211b29e5f64bb87faa08d7e2eea7ef%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637227386961766926&sdata=4OIoA4%2BRIzt8U0IqB9Rl2fnE%2FZIr1oUeWWqgB49p%2F8k%3D&reserved=0 for helping us catch that issue and build a better product :)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F51296%23issuecomment-615349821&data=02%7C01%7CTayo.Carvalhal%40microsoft.com%7Cef211b29e5f64bb87faa08d7e2eea7ef%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637227386961776921&sdata=Utlqo7%2ByVWTOQHmZSIp9qlz%2BxNjLpDSpcCpZK36zJNs%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE7FSC3CXZYHJCSTHZMOVVLRNCBQNANCNFSM4LW35DYQ&data=02%7C01%7CTayo.Carvalhal%40microsoft.com%7Cef211b29e5f64bb87faa08d7e2eea7ef%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637227386961776921&sdata=ioHcReJQYjJEtMyn%2FO8nRZZOQ3uTqDWFtKtFr9WQoVA%3D&reserved=0.

It does appear to still be bugged. Maybe they just fixed it specifically for @MattHartz instance.

@taysco My particular issue was that my POST was chunked. I haven't tried it recently to make sure it is still working. Are you doing something different?

@taysco and @lucarv can you please open a support ticket? We need to collect some details on your subscription ID and timing so that we can look into the logs and figure out what's going on - the easiest way to do that is via a support ticket.

@banisadr I certainly can next week. I've set myself a reminder.

120042021000847

Sent from Outlook Mobilehttps://aka.ms/blhgte


From: Scott Taylor notifications@github.com
Sent: Sunday, May 3, 2020 9:25:30 AM
To: MicrosoftDocs/azure-docs azure-docs@noreply.github.com
Cc: Tayo Carvalhal Tayo.Carvalhal@microsoft.com; Mention mention@noreply.github.com
Subject: Re: [MicrosoftDocs/azure-docs] Following documentation for Webhook, yet still receive "The attempt to validate the provided endpoint" (#51296)

@banisadrhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbanisadr&data=02%7C01%7CTayo.Carvalhal%40microsoft.com%7C84b52ebcc49d41d420e308d7ef33293c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637240875333376098&sdata=I0jEsJ85Dd%2F%2FCooCJ4ODkIjHn9uscn6O6PpfIDhhx6U%3D&reserved=0 I certainly can next week. I've set myself a reminder.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoftDocs%2Fazure-docs%2Fissues%2F51296%23issuecomment-623068170&data=02%7C01%7CTayo.Carvalhal%40microsoft.com%7C84b52ebcc49d41d420e308d7ef33293c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637240875333376098&sdata=cYQAwRska5h0JTch%2FJv0SrFJ19T4gQzPjaRNs%2F2n6IY%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAE7FSC2R7HXQXIH3Z5PW4JTRPUL6VANCNFSM4LW35DYQ&data=02%7C01%7CTayo.Carvalhal%40microsoft.com%7C84b52ebcc49d41d420e308d7ef33293c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637240875333386085&sdata=GDgBVAjWMH%2Fx5N%2B33a6gOkN9b9DFhghzgR1aV0pIiIo%3D&reserved=0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jebeld17 picture jebeld17  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments