iqoOopi
iqoOopi

Reputation: 180

Change result code for eventGrid triggered Azure function?

I know for http triggered function you can set context.res.status = 501, thus the results code in appInsight will change to 501. Wondering how can you do the same thing for eventGrid triggered azure function? we want some custom result code so that later on can run statistics.

enter image description here

Upvotes: 0

Views: 134

Answers (1)

SauravDas-MT
SauravDas-MT

Reputation: 1440

Current version of the EventGrid Triggered Azure Function does not support the scenario where the hosted code needs to control the HTTP status code returned to Event Grid. Given this limitation, your code running on an Azure Function would not be able to return a 5XX error. As a result any exception in the azure function will force a retry pattern when it is enabled.

For now to get control over the HTTP response, the recommended approach is using an HTTP triggered function.

You can check this Microsoft Document for more information.

You can also check this discussion on GitHub on the same topic.

Upvotes: 1

Related Questions