15

I have an Azure Website developed for which I would like to reduce the initial loading time. On a regular ASP.NET site I would configure the Application Initialization IIS module, but with Azure Websites direct IIS configuration is not possible.

The website is running in reserved mode if that makes any difference.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • I have idea of using endpoint monitoring feature. It checks web site availability, and as extra bonus - triggers code. – The Smallest Jul 13 '13 at 08:03

3 Answers3

15

Actually, Application Initialization module is installed by default for Azure Web Apps. You can directly configure it from either your web.config file or through apphost.config XDT. Just stick something like below in a web.config in the root of your web app.

<system.webServer>
  <applicationInitialization
    doAppInitAfterRestart="true"
    skipManagedModules="true">
    <add initializationPage="/default.aspx" hostName="myhost"/>
  </applicationInitialization>
</system.webServer>
David Aleu
  • 3,922
  • 3
  • 27
  • 48
NazimL - MSFT
  • 201
  • 2
  • 3
  • Does hostname need to be specified? What if I want to hit an instance before it is "scaled out"? Leaving hostname should hit localhost then right? – TWilly Mar 30 '17 at 15:43
6

Application Initialization is not supported with Windows Azure Websites. because it is a native module and Windows Azure Websites does not allow configuring native modules via web.config.

Alsom the content for Windows Azure Websites are physically located at a centralized location and from there they loaded and executed to webservers. While shared instance gets a slice of host VM, versus reserved instance get a full host VM to run your web applications, in both cases the website application is coming from same centralized located so it does not matter if you have reserve instance to get Application Initialization working.

Application Initialization is necessary for your application and your websites is running in reserve mode, you can use Azure VM or Windows Azure Web Role to have it working.

AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • I added an official request for this feature. Please consider voting it up: http://www.mygreatwindowsazureidea.com/forums/34192-windows-azure-feature-voting/suggestions/4152322-support-warm-up-initialization-in-azure-websites – Jeff Moser Jul 03 '13 at 12:45
  • @JeffMoser That link seems broken. Was your suggestion fixed? – Mark Seemann May 15 '14 at 06:30
  • Ah, I think I found it here: http://feedback.azure.com/forums/169385-web-sites/suggestions/4152322-support-warm-up-initialization-in-azure-websites – Mark Seemann May 15 '14 at 06:31
  • They delivered on @JeffMoser 's idea with deployment swap (which is awesome in its own right) in Jan 2014. I just opened another idea for enabling IIS8's Application Initialization feature in Azure Websites. Please vote it up: http://feedback.azure.com/forums/169385-websites/suggestions/6972595-application-initialization-to-warm-up-specific-pag – twamley Jan 16 '15 at 16:37
  • It's now available here: http://weblogs.asp.net/scottgu/windows-azure-staging-publishing-support-for-web-sites-monitoring-improvements-hyper-v-recovery-manager-ga-and-pci-compliance – Wojtek Turowicz Apr 01 '15 at 10:25
-4

Currently there's "Always On" setting for Azure Websites which does pretty much the same thing.

Always On Feature

Wojtek Turowicz
  • 4,086
  • 3
  • 27
  • 38
  • 5
    That is very much not the same thing. Consider the case where you want to initialize a WCF service host eagerly at startup rather than waiting for a request, e.g. so that you can participate in Azure Service Bus relays. Always On won't do anything in this case, the WCF service relay binding won't get initialized until the first message is received by the service. This is what the Application Initialization module addresses. – Alex Marshall May 01 '16 at 04:55