Unable to Subscribe to EventGrid Domain using Java Function App Event grid Trigger function

Ray, Tapan 5 Reputation points
2023-06-16T05:33:59.4633333+00:00

I am trying to subscribe a function in an isolated function app to an event grid domain and am receiving the following error:

{\"status\":\"Failed\",\"error\":{\"code\":\"ResourceOperationFailure\",\"message\":\"The resource operation completed with terminal provisioning state 'Failed'.\",\"details\":[{\"code\":\"Endpoint validation\",\"message\":\"Destination endpoint not found. Resource details: resourceId: /subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Web/sites/xxx/functions/event-subscriber. Resource should pre-exist before attempting this operation. Activity id:c1d3c2a0-eb71-445f-aa63-af46609980b9, timestamp: 6/15/2023 10:56:47 PM (UTC).\"}]}}

This error is occurring both when trying to add the subscription using Teraform as well as via the Azure web portal.

I have verified that the function app is running and that the function is visible.

Any help would be appreciated.

Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
397 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,356 Reputation points
    2023-06-16T16:24:51.61+00:00

    Ray, Tapan Thanks for posting your question in Microsoft Q&A. I assume you created Azure Event Grid trigger in Azure Functions and when creating an event subscription to Azure Functions failed with the above error (endpoint Type as Azure Function like below).
    User's image

    I quickly looked at the activity ID c1d3c2a0-eb71-445f-aa63-af46609980b9 and found that it was trying to connect webhook endpoint https://{funcapp-name}.azurewebsites.net/runtime/webhooks/eventgrid and failed with 400 bad request since it was unable to connect. I suggest you validate the endpoint URL correctly passed in Terraform or via portal as per doc: Webhook endpoint URL like eventgrid?functionName={functionname}&code={systemkey} and also make sure it is accessible from event grid (outside the portal). Also, check if the function parameters are configured correctly as described in Examples.

    If you still face the issue, please reach out to azure support team for further assistance. They have the best tools to review the backend logs and find the cause. I hope this helps and let me know if any questions.


    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.