Enabling web farms on Azure Web Apps

Microsoft Azure Web Apps allow you to scale the computing power (scale up) and the number of instances your application is replicated on (scale out), enabling you to increase the performance and throughput as necessary. Learn more about web app scaling in Microsoft Azure on Get started with Autoscale in Azure.

For the scale out functionality to work with Kentico, you need to enable and configure Web farms.

We only support this functionality for web hosting plans with a Basic or higher pricing tier.

To enable and configure Web farms in your Kentico application:

  1. If you have already scaled your web app to 2 or more instances, scale it back down to 1 instance:

    1. Open Windows Azure Management Portal -> App Services -> your web app.
    2. Switch to the Scale out (App Service plan) tab.
    3. Set the Instances count to 1.
    4. Click Save.
  2. Open the Kentico administration interface of your web app.

  3. Open the Settings application and select the Versioning & Synchronization -> Web farm category.

  4. Set the Web farm mode to Automatic.

    • This setting allows the system to generate and delete web farm servers dynamically according to the allocated computing instances.
    • See Setting up web farms for more information.
  5. Configure storing of session state data.

You can now increase or decrease the number of computing instances for your web app (in the Windows Azure Management Portal on the Scale out (App service plan) tab if your App service). The system generates web farm servers and synchronization tasks automatically.

Disabling file synchronization

When scaling an Azure Web Apps deployment of Kentico to multiple instances, you need to disable the file synchronization functionality of web farms. Azure Web App instances use a shared file system, so synchronization is not necessary and may lead to collision errors.

Add the following key to the appSettings section of the application’s web.config file:

<add key="CMSWebFarmSynchronizeFiles" value="false" />