What defines a failed request in Azure Functions?

Daniel Rosenberg 1 Reputation point
2021-04-09T12:06:07.397+00:00

We recently had an issue where one of our functions encountered an internal error and returned HTTP 500 for some requests.

While troubleshooting, we were surprised to find that none of our dashboards or alerts had discovered this, because these invocations were not detected as failed, despite the fact that they returned HTTP 500. Here is an example screenshot from the "monitor" tab of the function itself in the portal:

86247-screenshot-2021-04-09-at-135550.png

This is a bit unexpected, and begs the question: what does an invocation need to do to be considered failed in Azure Functions?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
{count} votes

2 answers

Sort by: Most helpful
  1. MikeUrnun 9,777 Reputation points Moderator
    2021-04-15T22:57:02.01+00:00

    Hi @Daniel Rosenberg

    I believe it's to do with a nuance between successfully (or unsuccessfully) handling the general mechanism of Requests/Responses (even though there were errors along the way during handling of requests) vs if the runtime was successful in handling the requests. Per Brett's comment on the answer to this post, please try passing in your Exception stack to your log.Error() calls and see if that produces a more intuitive view for your Dashboard.


  2. Lalit 1 Reputation point
    2021-08-11T16:01:08.5+00:00

    @Daniel Rosenberg , Azure Functions does not follow HTTP semantics.

    Success check for Azure Function is equivalent to "no exception thrown" and a Failed check is "exception thrown".

    Raising an exception and not returning a HTTP response will mark the Function execution as "Fail". Hope this helps.

    0 comments No comments

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.