Azure Web App (API) 因 Always On 功能突然在 Application Insights 中显示 404 错误。

huangapple go评论54阅读模式
英文:

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

问题

在过去的周末,没有在我们的端做任何更改的情况下,我们所有的API都每隔5分钟显示404错误。我们认为这是由于“Always On”功能访问了我们的API根目录,而这不是一个有效的端点所致。这是有道理的,但不合理的是,我们的这些API已经运行了数月,而在故障日志中并没有显示这些404错误,所以我有点犹豫是否要急于解决。

我找到了一篇可能的解决方案的文章:

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

但同样地,我希望在尝试修复之前了解为什么会发生这种情况。我也不确定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:

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.

答案1

得分: 2

是的,可能是“Always On”功能导致API出现404错误。

“Always On”功能每隔几分钟向应用程序的根发送请求,以保持其运行。如果您的API在根目录下没有有效的端点,它将返回404错误。

还有可能之前在失败日志中没有显示404错误,是因为之前未启用Always On功能。

要解决此问题,您需要在API的根目录下添加一个返回有效响应的端点,或者如果对您的应用程序不必要,可以禁用“Always On”功能。

应用集配置为“Always On”

Azure Web App (API) 因 Always On 功能突然在 Application Insights 中显示 404 错误。

404- 失败

Azure Web App (API) 因 Always On 功能突然在 Application Insights 中显示 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

Azure Web App (API) 因 Always On 功能突然在 Application Insights 中显示 404 错误。

404- Failures

Azure Web App (API) 因 Always On 功能突然在 Application Insights 中显示 404 错误。

For further information refer to SO Link

huangapple
  • 本文由 发表于 2023年4月20日 01:30:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76057315.html
  • azure
  • azure-application-insights
  • azure-web-app-service
  • http-status-code-404
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定