azure webapps 404 error

Venky picture Venky · Dec 5, 2017 · Viewed 8.1k times · Source

I have web application developed in Spring boot (REST services) which is deployed on Azure webapps (Azure app service). My plan is Standard: 1 Small.

The application has been running smoothly since 2 weeks. All of a sudden, today, the application went down. Consumer application which calls these REST services started experiencing 404 errors (The origin server did not find a current representation for target resource or it is not willing to disclose that one exists)

When I check the logs, I did not find any root cause which will bring whole application down. This was second time it happened and this time too I am unable to find root cause (Memory usage/CPU usage seems fine). "Always on" setting is turned ON.

I have following questions: 1) What may be the root cause and Is there a way to find it ?

2) Is there way (in azure webapps) to know when application goes down and auto scale ? (I have already set auto scale rules for CPU usage and Memory usage but this did not help).

Answer

Rob Reagan picture Rob Reagan · Dec 6, 2017

A few thoughts:

  1. If this is a critical service, you need two instances of your Web App running, even if you don't have the load to justify the second instance. The second instance is for reliability purposes.

  2. The fact that you're getting a 404 instead of a 50x makes me think that this isn't an issue with your server being too busy and giving up due to resource starvation such as CPU utilization, http queue length, etc.

Places to check for troubleshooting:

  1. On your Web App management blade in the Azure Portal, go to the Diagnostic Logs menu item. Turn on Application Logging, Web server logging, detailed error messages, and failed request tracing.

  2. After completing the previous step, you will be able to go to the Diagnose and Solve Problems menu option and view Failed Request Tracing Logs. You will also be able to browse both the web server logs and application logs. I find it easiest to use Visual Studio to do so.

  3. Just for fun, also check the Metrics per Instance under Diagnose and Solve problems. Check all categories during your reported 404 issue. This will let you check for conditions such as CPU usage, memory usage, number of threads, HTTP Queue length, etc.