Azure Web App (API) suddenly showing 404 errors in Application Insights due to Always On feature
Asked Answered
K

1

6

Over the past weekend without making any change on our end, all of our APIs are showing 404 failures every 5 minutes. We believe this is due to the Always On feature hitting the root of our API which is not a valid endpoint. This makes sense, but what does not make sense is we have had these APIs running for months without these 404 errors showing in the failure logs, so I'm a little hesitant to rush to a solution.

I did find an article talking about a possible solution here:

https://devblogs.microsoft.com/premier-developer/404-response-code-caused-by-app-services-alwayson-feature/

But again I'd like to understand why this is occurring before attempting to fix it. I'm also not sure if a URL rewrite is still the best way to go about this or if we should do something else like adding an endpoint to the root.

Any help is appreciated.

Kinshasa answered 19/4, 2023 at 17:30 Comment(0)
S
4

Yes, it is possible that the Always On feature is causing the 404 errors in your API.

The Always On feature sends a request to the root of your application every few minutes to keep it warm. If your API does not have a valid endpoint at the root, it will return a 404 error.

It is also possible that the 404 errors were not showing up in the failure logs previously because the Always On feature was not enabled.

To fix this, you need to add an endpoint to the root of your API that returns a valid response. or you need to disable the Always On feature if it is not necessary for your application.

Configuration of App Set to Always On

enter image description here

404- Failures

enter image description here

For further information refer to SO Link

Swithin answered 21/4, 2023 at 9:43 Comment(2)
I do see thousands of requests to "GET /" (root) over the last few months, none of them resulting in failure until last weekend. We did not make any changes but there is always a chance that Microsoft did.Kinshasa
We have the exact same issue since this week. Always On has been enabled for years and suddenly this is showing 404 errors in AI of our API, where Always On is enabled.Burble

© 2022 - 2024 — McMap. All rights reserved.