Home > Back-end >  Azure Event Grid Trigger Function retry on 500
Azure Event Grid Trigger Function retry on 500

Time:07-03

I have created Azure Function of type EventGridTrigger as subscriber to a topic in Event Grid. This function calls the downstream api using rest client.

However there could be scenarios where downstream api is not avaialble or there is exceptions while calling downstream api from EventGridLtrigger. In such case I have observed EventGridTopic is still showing Event as delivered instead of retrying on failure.

Is there anyway possible to get EventGrid to retry delivery or possibly add the event in deadletter queue when there is processing failures?

CodePudding user response:

  • Eventgrid will retry if and only if the failure is not because of a configuration error which intrinsically cannot be solved by the retry.

  • You can configure retry policy by configuring two variables Max ammount of retry and event time to live. As their name suggest maximum attempts which can be made before either droping the message or dead lettering it, event time to live will configure the time between each retry by default it is 1440.

You can configure retry policy when you create the event grid.

az eventgrid event-subscription create \ 
-g gridResourceGroup \ 
--topic-name  <topic_name> \ 
--name  <event_subscription_name> \ 
--endpoint  <endpoint_URL> \
 --event-ttl  720\
 --max-delivery-attempts  18

Reference:

Retry in event grid

CodePudding user response:

If there is internal server error (status code 500) in the Azure EventGrid Trigger function, Event Grid will retry delivery based on the configuration. Use below link for more details.

https://github.com/Azure/azure-functions-eventgrid-extension/issues/32

  • Related