Automatically launch the Azure website after deployment

A have azure webrole with test page and service in this role. After the role is published, it does not start automatically, only at the first use. So if the role closes for some reason, the first use after that happens rather slowly.

Is there a way to get webroles to start automatically immediately after they are deployed (both for the first time and after migration)?

+7
source share
2 answers

Check out IIS 7.5 Auto Launch . Make sure you set osFamily = "2" for webrole to use Windows 2008 R2.

Edit: we were still stuck on osFamily = "1" for technical reasons, so we have not yet been able to implement the automatic launch feature. However, here are the steps that will be required to set up automatic start:

  • Create your own autorun that implements the IProcessHostPreloadClient interface . It used to be a default provider called the Warm-Up Module , but it is no longer available for download. You can use .Net Reflector to view the contents of the Microsoft.ApplicationServer.Hosting.AutoStart.ApplicationServerAutoStartProvider.dll file as an example implementation. This DLL is included in the Windows Server (non-Azure) AppFabric application.

  • The next step is to specify the correct settings in your Host.config application. Some change to the code shown here can be introduced into your RoleEntryPoint class so that it is called when your Azure role is activated.

Please let the community know if you have successfully created your own autorun. At the moment, there is not much information on the implementation of IProcessHostPreloadClient on the Internet.

+5
source

The role is usually restarted approximately once a month, to serve the OS either by the guest or the main operating system. What you are likely to see is the AppPool timeout due to inactivity, which will show the same type of initial strike delay. The default timeout is 20 minutes. You can change the timeout with an increased script run, with something like:

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

I discussed this in another SO question .

+2
source

All Articles