Share via

Replay a azure function using event grid

Shweta 81 Reputation points
2021-08-25T07:12:46.733+00:00

Suppose I have a function1 (http trigger) that calls a third party API to update/add some data & in a some scenario third party API returns 404/500 etc error. So in that case I have to replay the function1. So how can i achieve that, I mean if I'm using grid event so how can I push the function1 to grid event to replay or is there any other better approach?

Azure Event Grid
Azure Event Grid

An Azure event routing service designed for high availability, consistent performance, and dynamic scale.


Answer accepted by question author
  1. Pramod Valavala 20,661 Reputation points Microsoft Employee Moderator
    2021-08-26T16:12:08.637+00:00

    @Shweta Firstly, you could retry the API call in your function itself before failing assuming your function isn't running close to the timeout for one call itself. This could be done either in your code or using retry policies (note that this is in preview).

    Next, if all retries end up failing, then you could simply push an event to Event Grid or a message to Service Bus. To process these messages, you would need another function/logic app that would trigger on these messages and call the failed function. The message could include information like what function failed, what the payload is, etc.


0 additional answers

Sort by: Most helpful

Your answer

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