英文:
Azure Web App (API) suddenly showing 404 errors in Application Insights due to Always On feature
问题
在过去的周末,没有在我们的端做任何更改的情况下,我们所有的API都每隔5分钟显示404错误。我们认为这是由于“Always On”功能访问了我们的API根目录,而这不是一个有效的端点所致。这是有道理的,但不合理的是,我们的这些API已经运行了数月,而在故障日志中并没有显示这些404错误,所以我有点犹豫是否要急于解决。
我找到了一篇可能的解决方案的文章:
但同样地,我希望在尝试修复之前了解为什么会发生这种情况。我也不确定URL重写是否仍然是最佳方法,或者我们是否应该做一些其他操作,比如在根目录添加一个端点。
感谢任何帮助。
英文:
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:
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.
答案1
得分: 2
是的,可能是“Always On”功能导致API出现404错误。
“Always On”功能每隔几分钟向应用程序的根发送请求,以保持其运行。如果您的API在根目录下没有有效的端点,它将返回404错误。
还有可能之前在失败日志中没有显示404错误,是因为之前未启用Always On功能。
要解决此问题,您需要在API的根目录下添加一个返回有效响应的端点,或者如果对您的应用程序不必要,可以禁用“Always On”功能。
应用集配置为“Always On”
404- 失败
有关更多信息,请参阅Stack Overflow链接。
英文:
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
404- Failures
For further information refer to SO Link
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论