question

Shweta-1833 avatar image
0 Votes"
Shweta-1833 asked Shweta-1833 commented

Replay a azure function using event grid

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
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Any suggestion would be helpful.

0 Votes 0 ·

@85446611 any idea on this? please suggest, it would be really helpful. thanks.

0 Votes 0 ·

@PramodValavala-MSFT Do you have any idea on this? please suggest, it would be really helpful. thanks

0 Votes 0 ·

@Shweta-1833 Could you please elaborate on the ask? Do you mean to push the error to Event Grid when there is a failure in your function invocation?

0 Votes 0 ·

@PramodValavala-MSFT 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?

0 Votes 0 ·
Show more comments

1 Answer

PramodValavala-MSFT avatar image
0 Votes"
PramodValavala-MSFT answered Shweta-1833 commented

@Shweta-1833 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.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.