1

I've got an asp.net core web app that runs, quite hapily (most of the time), in Azure as an windows app service.

However, we sometimes see the web app restarts occaisionly - sometimes in bursts, say 10 in a minute, and we're not sure why this is happening. We know it's probably not something on Azure's side, becuase our web jobs continue to run and don't restart.

My theory is that something pretty bad happens in the web app, and crashes the dotnet process, so it restarts. However I can't see any evidence of this happening - no event logs, or anything that I can analyse. Is it possible to add logging in azure, so that if something does take down dotnet and cause it to restart, we can find out more?

Matt Roberts
  • 26,371
  • 31
  • 103
  • 180
  • Check out this answer(the update part), it should help you to troubleshoot the cause: https://stackoverflow.com/questions/45021644/is-there-way-to-determine-why-azure-app-service-restarted – Hackerman Dec 20 '17 at 20:34
  • Thanks - I should add that I've checked Azure's diagnostics, and it doesn't report any restart events, even though my own logs show this is happening. – Matt Roberts Dec 20 '17 at 20:37
  • Maybe it just about `The default configuration for windows azure websites and cloud services is to unload your application if it have not been access for a certain amount of time. It makes a lot of sense for Microsoft to do this, as they save resources on by stopping infrequently accessed sites.` – Hackerman Dec 20 '17 at 20:41
  • You can also enable `Always On`..form the docs `Always On. By default, web apps are unloaded if they are idle for some period of time. This lets the system conserve resources. In Basic or Standard mode, you can enable Always On to keep the app loaded all the time. If your app runs continuous WebJobs or runs WebJobs triggered using a CRON expression, you should enable Always On, or the web jobs may not run reliably.`. Source: https://learn.microsoft.com/en-us/azure/app-service/web-sites-configure – Hackerman Dec 20 '17 at 20:43
  • Yup, `AlwaysOn` is on, and this is a very traffic-heavy site (again, I should have added that in the description) – Matt Roberts Dec 20 '17 at 21:46
  • 1
    have you tried to turn on the tracing for core web app? https://github.com/projectkudu/kudu/wiki/Troubleshooting-.NET-Core-errors – watashiSHUN Dec 21 '17 at 02:34

0 Answers0