Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic start of Azure webrole after deploy

A have an azure webrole with a test page and a service in that role. After publishing the role it doesn't start automatically, only at first use. So if the role is shut down for some reason the first usage after that is quite slow.

Is there a way to make webroles start automatically right after they are deployed (either first time, or after a migration)?

like image 286
Attila Klenik Avatar asked Mar 06 '12 08:03

Attila Klenik


1 Answers

Check out the auto start feature of IIS 7.5. Make sure you set osFamily="2" for the webrole so that it uses the Windows 2008 R2 OS.

Edit: We're still stuck on osFamily="1" for technical reasons, so we haven't been able to implement auto start functionality yet. However, here are the steps that would be required to setup auto start:

  1. Create your own auto start provider that implements the IProcessHostPreloadClient interface. There used to be a default provider called the Application Warm-Up Module, but it's not available for download anymore. You can use .Net Reflector to view the contents of the Microsoft.ApplicationServer.Hosting.AutoStart.ApplicationServerAutoStartProvider.dll as an example implementation. This dll is included in Windows Server (not Azure) AppFabric.

  2. The next step is to specify the correct settings in your applicationHost.config. Some variation of the code listed here can be entered in your RoleEntryPoint class so that it's called when your Azure Role fires up.

Please let the community know if you successfully create your own auto start provider. At this point, there isn't a lot of information about implementing IProcessHostPreloadClient on the internet.

like image 134
Jonathan McIntire Avatar answered Oct 12 '22 15:10

Jonathan McIntire