Palmi
Palmi

Reputation: 2521

Azure web apps life cycle

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?

Upvotes: 3

Views: 494

Answers (1)

Dai
Dai

Reputation: 155145

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:

Upvotes: 4

Related Questions