Apparently, Azure App Service has a 230-second timeout.. However, when I look at my logs in App Insights' Request table, I see requests to my .NET API with 400-500 seconds duration that resulted in 200. On the other hand, I do see some 500s where the duration is over 230 seconds.
So my question is why do I see this discrepancy?
I can think of two theories:
- Either, the 230 seconds is not always enforced.
- Or the logs in the Request table in App Insight, show the information from what is returned from the app, and NOT the actual user experience. i.e. if, for example, my backend takes 300 seconds and returns a 200, then that's what I see in logs. However, the user got a 500 after 230 seconds.
CodePudding user response:
Answering my own question in case anyone ran into this ...
I did some testing and confirmed that the 230s timeout is indeed enforced, i.e. the caller of the API would get a 500 after 230s if the API hasn't returned a response yet. However, the duration
field in the logs' Request table indicates the time the app took to return a response, i.e. if the API takes 5 minutes to return a 200, the caller would get a 500 right after 230 seconds, however, in the logs, you'd see the request took 5 minutes.
CodePudding user response:
That timeout is enforced on load balancer and its documented. But app service will continue to process your request it will only affect your client.
If you need to know when something completed then probably have a look into Asynchronous Request-Reply Pattern