MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.18k stars 21.32k forks source link

comment on manual validation of webhook subscription creation event when using ngrok #85960

Open lindacmsheard opened 2 years ago

lindacmsheard commented 2 years ago

[docs augmentation - solution provided]

When you create a storage event subscription as a webhook to connect storage events to your ngrok endpoint, the current version expects validation (see here). I created the event subscription via the cli, and so the information as to how to validate manually would be helpful to have in the docs:

ngrokendpoint=https://<guid_from_ngrok_output>.ngrok.io
az eventgrid event-subscription create  --name testdocsub \
                                         --source-resource-id $sourceid \
                                         --included-event-types Microsoft.Storage.BlobCreated \
                                         --subject-begins-with /blobServices/default/containers/mycontainer/path/ \
                                         --subject-ends-with .json \
                                         --endpoint-type webhook \
                                         --endpoint  $ngrokendpoint \
                                         --labels mylabel

This command will hang with a Running... line in the terminal, as it is waiting for validation, and then time out with a provisioning status of Failed.

To fix this, within 5 minutes, navigate to localhost:4040 in the web browser on the local machine to be able to inspect the messages received by ngrok. The message received by POST request on execution of the above command will be shown, and conforms to the validation format described in the docs here.

Navigating to the validationUrl in the browser then validates the subscription creation, the browser will return '"Webhook succesfully validated as a subscription endpoint."' and the command above will complete the provisioning.

It would be useful to have this in the docs, because to new users of ngrok it may not be obvious where to find the validation message content.


Document details

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

MayankBargali-MSFT commented 2 years ago

@lindacmsheard Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.