3

How often does a web app (in Azure) restart?

For example with a MVC application: How often is the Application_Start() method in the global.asax.cs called?

Palmi
  • 2,381
  • 5
  • 28
  • 65

1 Answers1

4

This isn't Azure-specific. ASP.NET Web Applications run in w3wp.exe and can be killed and recycled by IIS at any time, without warning. The first request after a kill will cause Application_Start to be invoked again.

Depending on how active your website is, IIS may kill your website after a period of inactivity (to free-up memory), on the next request to your site IIS will relaunch the application and call Application_Start.

There are also circumstances where Application_Start will be called more than once for a single application initialization, though this is usually due to a misconfiguration:

Community
  • 1
  • 1
Dai
  • 141,631
  • 28
  • 261
  • 374