Is there any best practice or recommendation around applicationIntialization?

  1. Should we use this?
  2. What is the best way to warm up or improve start up time of CMS and CD website after swap deployment slot?
  3. Any recommendation or best practice?
  4. Pros and cons if any?
  5. Suggestion Warmup around prefetch cache after app pool recycle or changes to production?

3 Answers 3


I can give some input regarding App Initialization in general on Azure App Service:

  1. During slot swap, you don’t want your 'preprod' to be activated into production (swap) without having been warmed up beforehand. Using AppInit the swapping operation will only occur once the load balancer received an HTTP Response from the init module. (Note this response can be anything, also a 404 or 500 so take that into account). If you are using Swap with Preview and running smoke tests or UI tests on that slot before swapping then the appinit will have less impact.

  2. During scale up: in Web apps, scale up of an App Service Plan means the Web App is moved onto new machines. These are going through cold start. Again using the AppInit the scale up will only take place through the DNS load balancer once a response has been received from the module.

  3. During scale out: when a new machine is added to the App Service plan, you’d want the requests to be distributed to the new machine as well, but only after cold start. App Init will also have effect here as the new machine will only be added to the load balancer after going through the appinit. In all cases, ongoing requests to the production slot, or to the smaller scale app will be gracefully completed, and new requests will end up on the new slot/machine).

See also this article: http://ruslany.net/2015/09/how-to-warm-up-azure-web-app-during-deployment-slots-swap/

  • Thanks ,This is helpful.With above explanation I understand that, during scale up the app init is pretty straight forward as there is only increase in resources whereas in scale out it require more smarts to ensure warmup is initiated across all the VMs. Apr 19, 2017 at 2:59
  • Actually I want to be sure I explain this correctly: Apr 20, 2017 at 15:32
  • 1
    Scale out: add machines indeed it requires the warm-up and AppInit makes sure new machine is not added to the pool until warmup is finished (until AppInit module gets a response from the provided URIs) Apr 20, 2017 at 17:54
  • 1
    Scale up: also in this case you actually are landing on complete new machines. In App Service, when you scale UP an App Service Plan, your apps are moved from a size x (S1 for example) machine to a size y (S2 for example) machine. While requests keep running on the old machine size, the load balancer will direct new requests to the new machine as soon as AppInit returns. So the concept is pretty similar. This is because ASPs run on pools of machines from a certain size. To scale up it's not the machine that gets new resources, it's the web app that moves out to a new pool of machines. Apr 20, 2017 at 17:54

Currently there is no official Sitecore recommendation on this. Also applications can be different and require different settings.


We are using Sitecore 9.1.0 and we have defined 52 URLs in applicationInitialization of our web application, which lead to an error: "No owin.Environment item was found in the context." If you have 5 URLs - it does not errors out.

I reached Sitecore Support on this matter and got an answer from them:

I have performed some additional investigation regarding your issue and would like to share the following with you.

Using the setting was discussed with our development team and they confirmed that it had not been tested for Sitecore application.

Thus, we have registered a wish to have this question investigated for future versions of Sitecore.

To track the future status of this request, please use reference number 300564.

More information about public reference numbers can be found here: https://kb.sitecore.net/articles/853187.

Taking the fact that Sitecore does not have any official guidelines on configuring Azure App Initialization feature, the nature of the question you have posted falls outside the scope of the technical support described here.

It means that we are not able to provide you with the requested kind of assistance via the Sitecore Support Portal.

So, this means that usage of appInit feature is discouraged by Sitecore Support :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.