---
title: Migration of Kentico projects from Azure Cloud Services to Azure Web Apps
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The scenario described on this page assumes that you have a Kentico Azure project running in Azure Cloud Services, connected to the Azure SQL server and Azure Blob Storage and you have access to the local development project. When you decide to migrate your project from Azure Cloud Services to Azure Web Apps, you need to create a new Web App service and transfer your configurations to the web.config file of your project. You can utilize the existing Azure SQL Database and Azure Blob Storage.

To migrate an Azure project from Cloud Services to Web Apps, you need to:

1. [Transfer configurations](#part-1---configuring-azure-projects-for-azure-web-apps) from the ServiceConfiguration.Cloud.cscfg file to the web.config file.
2. [Create a new Azure Web App service](#part-2---creating-azure-web-apps-from-visual-studio).
3. [Deploy the project as a web application through Visual Studio](#part-3---deploying-azure-projects-to-azure-web-apps). Alternatively, you can also [deploy your project over FTP](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/setting-up-kentico-in-azure-web-apps.md).

## Part 1 - Configuring Azure projects for Azure Web Apps

You can deploy only Kentico web site or web application projects to Azure Web Apps. Kentico projects installed as Azure projects contain a standard web application project in them. Therefore, you need to transfer configuration settings from the **ServiceConfiguration.Cloud.cscfg** file to the **web.config** file in the web application project and then deploy the web application project to Azure Web Apps.

1. Open your Azure project in Visual Studio using the **WebApp.sln** file.
2. Open the **CMSApp\Web.config** file.
3. Add the **CMSConnectionString** key and value to the _connectionStrings_ section of the web.config file.

   ```xml

   <connectionStrings>
       <add name="CMSConnectionString" connectionString="Data Source=tcp:YourServerName.database.windows.net,1433;Initial Catalog=YourDatabaseName;User Id=YourUsername@YourServerName;Password=YourPassword;" />
   </connectionStrings>

   ```
4. Add the **CMSAzureAccountName** and **CMSAzureSharedKey** keys to the _appSettings_ section of the web.config file.

   ```xml

   <appSettings>
       ...
       <add key="CMSAzureAccountName" value="StorageAccountName" />
       <add key="CMSAzureSharedKey" value="PrimaryAccessKey" />
   </appSettings>

   ```

   > **Info:** Replace _StorageAccountName_ and _PrimaryAccessKey_ with values from the ServiceConfiguration.Cloud.cscfg file.
5. Configure the application to use Azure Blob storage according to the instructions in [Configuring Azure storage](https://docs.kentico.com/k11/custom-development/working-with-physical-files-using-the-api/configuring-file-system-providers/configuring-azure-storage.md).

   > **Note:** For Azure Web Apps deployments, we recommend mapping _**only media library folders**_ to the Azure storage.
   >
   > In this scenario, you need to manually transfer any project files that exist on your Blob storage, but are not present in your local development project. Do not transfer your media library folders and the folders listed in [Azure Web Apps problematic folders](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/azure-web-apps-problematic-folders.md).
6. Right-click the **CMSApp** project in the Solution Explorer and select **Set as StartUp Project**.
7. Transfer any custom settings from the ServiceConfiguration.Cloud.cscfg file to the web.config file.

Your project is now ready to be deployed to Azure Web Apps, but first you need to create a new Azure Web App service.

## Part 2 - Creating Azure Web Apps from Visual Studio

Before you can deploy your project, you need to create a new Azure Web App service. You can do this from the [Microsoft Azure management portal](https://portal.azure.com/) or directly from Visual Studio:

1. Open your Kentico project in Visual Studio via the **WebApp.sln** file.
2. Open the **Server Explorer** tab (or Database Explorer tab in Express editions of Visual Studio).
3. Right-click **Azure**, select **Connect to Microsoft Azure Subscription** and sign in to your Azure account.
4. Expand the **Azure** node.
5. Right-click **App Service** and select **Create New App Service...**.

   1. On the **Hosting** tab, enter your web app name, select your subscription, Resource Group, and App Service Plan.
   2. On the **Services**tab, create an SQL database for the application if necessary.
6. Click **Create**.
   - The system creates a new Azure Web App.
7. Right-click the newly created web app and select **View settings**.
8. Modify the connection string to connect to your database deployed to an Azure SQL server (change the name of the database to correspond to your Azure SQL database).

You can view the newly created Azure Web App in the [Azure management portal](https://portal.azure.com/) under Web Apps. The Web App service is now empty. You can now deploy your web application project to Azure Web Apps.

> **Info:** **Automatically created Azure SQL Database**
>
> Note that creating a Web App from Visual Studio also creates a new Azure SQL Database on the specified server. If you already have a database on Azure, you will not need this automatically created database. Therefore, you should delete this database to avoid additional costs:
>
> 1. Open the [Azure management portal](https://portal.azure.com/).
> 2. Select **SQL Databases**.
> 3. Select the automatically created database. The name should correspond to the name of the newly created Web App with a '_\_db'_ suffix.
> 4. Click **Delete**.

## Part 3 - Deploying Azure projects to Azure Web Apps

You are deploying your Azure project as a Kentico web application project.

1. Open your Kentico project in Visual Studio via the **WebApp.sln** file.
2. Open the web.config file and make sure that the _sessionState_ mode is set to **InProc**.

   ```xml

   <sessionState mode="InProc" />

   ```

   > **Info:** Use _InProc_ mode if you plan to use one instance of the Web App service. If you want to scale your web app to more instances, you will need to configure the session state differently. See [Storing cache and session state data in Azure environment](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/storing-cache-and-session-state-data-in-azure-environment.md).
3. Right-click the **CMSApp** project in the Solution Explorer and select **Publish**.
4. Select **Microsoft Azure App Service**.
5. Select the previously created web app in the drop-down list.
6. Click **OK**. The system downloads the publish profile.
7. Leave the settings as they are.
8. Click **Publish**.

The system deploys your project to the Azure Web App service. Check that the project is correctly connected to the database (the database installation dialog does not appear).

Proceed to performing the following final configurations:

- [Adjust the web hosting plan mode for your Web App service](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/adjusting-the-web-hosting-plan-mode-on-azure-web-apps.md).
- Check that your Azure SQL database adheres to our [recommendations](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/recommendations-on-using-azure-sql-database-tiers.md).
- [Increasing storage capacity on Azure Web Apps](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/increasing-storage-capacity-on-azure-web-apps.md)

After that, your Kentico project is ready to run in Azure Web Apps.

## Configuring web farms for Azure Web Apps

If you plan to increase the number of instances associated with your Web App service (via the **Scale out (App Service plan)** tab), you need to configure web farms in your project to dynamically create and delete web farm servers. See [Enabling web farms on Windows Azure Web Apps](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/enabling-web-farms-on-azure-web-apps.md) for instructions.

Web farms are configured automatically for Cloud Services environment, however, they need to be enabled manually in Web Apps.
