none
Application Initialization - Can hostName point to another domain when using App Service RRS feed

  • Question

  • Hi All,

    I have a problem getting the app initialization to work properly when swapping slots. I have followed this post http://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/ which in theory covers everything that I need.

    I have created a dummy warm-up service at http://warmup.azurewebsites.net/home . It will return a response after 60 seconds.

    The main site (http://main-warm.azurewebsites.net/) uses this service for initialization:

    <applicationInitialization doAppInitAfterRestart="true" skipManagedModules="true">
          <add initializationPage="/home" hostName="warmup.azurewebsites.net"/>
        </applicationInitialization>

    So far I had no luck in getting this to work. Not sure if calling another domain is supported.

    Any feedback is appreciated.


    Friday, July 28, 2017 4:52 PM

Answers

All replies

  • Could you elaborate more on “Not sure if calling another domain is supported”?

    You can specify multiple URL paths that need to be requested in order to warm up your application. As mentioned, you can specify the host name to use for the warm up requests (this is optional and if not specified the “localhost” will be used as a host name).

    You may want to check the article for Understanding site swaps.

    -----------------------------------------------------------------------------------------------
    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Saturday, July 29, 2017 8:44 AM
    Moderator
  • Sorry for not providing additional details.

    So far I have tested two scenarios - in the first one the warm-up works just fine, but I get some strange results in the second scenario.

    Scenario 1

    Site - https://main-warm.azurewebsites.net
    Warm-up - warmup-cache.php (same as in the mentioned blog post)
    App init config:

    <applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false">
    <add initializationPage="/warmup-cache.php" hostName="main-warm.azurewebsites.net"/>
    </applicationInitialization>

    This works fine confirmed by the IIS log (scenario1.xml) - Time Taken 30328 msec

    Scenario 2.

    Site - https://main-warm.azurewebsites.net
    Warm-up - warmup.azurewebsites.net (Notice that this is on another host name, not the one that is being warmed-up)
    App init config:

    <applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false">
        <add initializationPage="/" hostName="warmup.azurewebsites.net"/>
    </applicationInitialization>

    With this configuration I get strange results. The warm-up page does get a hit but it returns almost immediately. This makes no sense because the site has a Thread.Sleep(30). If you simply browse to warmup.azurewebsites.net you can confirm that it should take ~30 sec to execute the request (scenario2.xml).

    Scenario2.xml - Time Taken 141 msec

    Those results led me to believe that there is something funny going on when the warm-up page is on another host - not the one that is being warmed-up. 

    Hope that this makes more sense now.


    • Edited by Vayikra Friday, August 4, 2017 5:37 PM
    Saturday, July 29, 2017 9:17 PM
  • Hi Vayikra,

    The hostname parameter in the appInit module configuration is used to specify what value to set in the Host header of the warmup requests to the site that is being warmed up. It does not mean that the appInit module will make an http request to that remote URL.

    So to answer your question: second scenario works as expected and appInit is warming up the root directory of your current site (https://main-warm.azurewebsites.net). It will never make an HTTP request to http://warmup.azurewebsites.net


    http://ruslany.net/

    Thursday, August 3, 2017 5:26 PM