Automatic start of Azure webrole after deploy

后端 未结 2 2021
名媛妹妹
名媛妹妹 2021-02-09 04:27

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 fo

2条回答
  •  萌比男神i
    2021-02-09 04:54

    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.

提交回复
热议问题