azureazure-web-app-serviceazure-app-service-envrmnt

How do I use ApplicationInitialization to control the endpoint for Azure's Always On feature?


According to this answer on another question, ApplicationInitialization can be used to control the endpoint that the "Always On" feature for Azure's App Services uses. However, I cannot find documentation on this. All of the docs I can find on ApplicationInitialization only talks about using it to specify pages for warmup prior to putting the instance of the site into the load-balancing pool (note the plurality of "pages"). But I cannot find anything to specify the single endpoint that the Always On feature uses.

My desired goal is to have the Always On feature ping a hearbeat page of sorts with a custom querystring (i.e. a key so it's somewhat locked down).

How can I use ApplicationInitialization to specify the custom page that the "Always On" feature hits?


Solution

  • AlwaysOn cannot be used to specify a single endpoint. It will always hit root url.

    But you can indeed specify AppInit parameter in your web.config like so:

    <system.webServer>  
      <applicationInitialization >  
        <add initializationPage="/mycustompage" hostName="host.azurewebsites.net"/>  
      </applicationInitialization>  
    </system.webServer>   
    

    You can read more about this feature here: http://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/

    And on Azure feedback website: https://feedback.azure.com/forums/169385-web-apps/suggestions/6972595-application-initialization-to-warm-up-specific-pag