0
votes

I have been trying to create an event grid subscription to an Event Grid Trigger function which is created to capture Blob storage events, using ARM templates. I successfully create the function app resource first, then try to create the event grid subscription on the created function app, but it fails with the following error:

    "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://myfunction.azurewebsites.net/runtime/webhooks/eventgrid failed. For more details, visit https://aka.ms/esvalidation."
      }
    ]
  }

Here I have used webhook URL as the endpoint. I've come to know that there is a validation call that goes back to the function app to verify its existence.

My question is, do we need to publish the Event Grid Trigger function to the function app before trying to create an event grid subscription for that?

P.S. I have also tried the same order with AzureFunction as the endpoint type (2020-01-01 version), but it still failed to create the subscription.

1

1 Answers

1
votes

Based on the validation details described here:

At the time of event subscription creation/update, Event Grid posts a subscription validation event to the target endpoint

as a workaround, you can use a dummy (nop operation) subscriber handler endpoint for creating your subscription and then update a webhook endpoint with your real subscriber handler endpoint.