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
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With