Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Windows Azure support the Application Warm-Up module or something similar?

Tags:

asp.net

iis

azure

We have a Web Role that we are hosting in Windows Azure that uses an old ASMX based Web Reference to contact an external system. The Web Reference proxy code is big enough that instantiating it the first time has a significant cost.

We'd like to be able to have this run when the Web Role starts instead of on the first request.

I know IIS 7.5 has an Application Warm-Up module that would allow us to achieve this, but I'm having trouble figuring out if something similar exists with hosting on Windows Azure.

Thanks, Corey

like image 592
Corey O'Brien Avatar asked Mar 19 '10 17:03

Corey O'Brien


2 Answers

I like the solution from Steve Marx.

Add this lines to ServiceDefinition.csdef:

<Startup>
  <Task commandLine="startup\disableTimeout.cmd" executionContext="elevated" />
</Startup>

And add disableTimeout.cmd in a folder called startup, with the following line of code:

%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00

Original solution from here: http://blog.smarx.com/posts/controlling-application-pool-idle-timeouts-in-windows-azure

When running in the emulator please read this: http://blog.smarx.com/posts/skipping-windows-azure-startup-tasks-when-running-in-the-emulator

like image 73
m_david Avatar answered Nov 13 '22 22:11

m_david


It looks like the Application_Start handler in Global.asax gets executed when the Web Role is deployed (for ASP.NET) and not on the first request, so that will work for us.

like image 41
Corey O'Brien Avatar answered Nov 13 '22 21:11

Corey O'Brien