---
title: Setting up Kentico in Azure Web Apps
related:
  - https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/lifecycle-for-developing-kentico-projects-in-azure-cloud-services.md
  - https://docs.kentico.com/k9/deploying-websites/publishing-projects-from-visual-studio.md
---

> 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).

This scenario expects that you want to create a new Kentico website as a Azure Web Apps service. You can create a new Kentico website:

- [From the Microsoft Azure Marketplace](#creating-azure-web-apps-from-the-microsoft-azure-marketplace)
- [From Visual Studio](#creating-azure-web-apps-from-visual-studio)
- [Setting up Kentico in Azure Web Apps](#uploading-kentico-to-azure-web-apps-over-ftp)
- See other options of [deploying Kentico to Azure Web Apps in the Microsoft documentation](https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-deploy)

## Creating Azure Web Apps from the Microsoft Azure Marketplace

You can find a Kentico package in the Azure marketplace. Creating new web apps using the provided template is quick and easy.

1. Open the [Azure Management Portal](https://portal.azure.com/).
2. Click **New -> Web + Mobile**.
3. Click **See all** and search for **Kentico CMS**.
4. Select **Kentico CMS** from the list of results and click **Create**on the newly opened tab.
5. Type the URL (name) of your web app.
6. Select a Resource Group.
7. Set your preferred [App Service plan](https://azure.microsoft.com/en-us/pricing/details/app-service/plans).
8. Select an existing or create a new SQL database and server.

   ![Creating a Kentico instance in Azure Web Apps](https://docs.kentico.com/docsassets/k9/setting-up-kentico-in-azure-web-apps/CreatingKenticoInstanceWebApps.png "Creating a Kentico instance in Azure Web Apps")
9. Click **Create**.

### Database installation

1. Access the created website.
2. Provide the server name and credentials for the server where you created the database.
3. Click **Next**.
4. Select **Use an existing database** and type the name of the database created for the website.
5. Click **Next**.
6. Click **Next** without filling in any fields.
7. Select **Create a new site or import an existing Kentico site** and click **Next**.

   - The installer redirects you to the Kentico administration interface.
8. Switch to the **Licenses** tab and add the license for the website domain.

Perform the following final configurations:

- [Adjust the web hosting plan mode](https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/adjusting-the-web-hosting-plan-mode-on-azure-web-apps.md) for your web app.
- Configure the tier of your Azure SQL database according to our [recommendations](https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/recommendations-on-using-azure-sql-database-tiers.md).

## Creating Azure Web Apps from Visual Studio

This scenario presumes that you already have a Kentico project installed on a local computer and you want to deploy it to the Azure Web App service using Visual Studio. You can also create the Web App service directly from Visual Studio.

> **Info:** In Microsoft Visual Studio 2012 and 2013, the service is still called Azure Websites.

1. Open your Kentico project in Visual Studio.
2. Open the **Server Explorer** tab (or Database Explorer tab in Express editions of Visual Studio).
3. Expand the **Azure** section, right-click **App Service**, and select **Create New App Service...** 

   - A **Create App Service** window opens.
4. On the **Hosting** tab:
   1. Type the web app name (URL).
   2. Select the Azure subscription under which the Web App will be created.
   3. Select an existing Resource Group or create a new one.
   4. Select an existing [App Service plan](https://azure.microsoft.com/en-us/pricing/details/app-service/plans) or create a new one.

      ![Creating an Azure App Service application in Visual Studio](https://docs.kentico.com/docsassets/k9/setting-up-kentico-in-azure-web-apps/DeployFromVS2015-Hosting.png "Creating an Azure App Service application in Visual Studio")
5. Switch to the **Services** tab and create a new SQL Database for the application:
   1. Select an existing or create a new SQL server.
   2. Provide administrative credentials for the server.
   3. Specify a name for the application's database.
   4. Set **Connection String Name** to _CMSConnectionString_.

      ![Creating an Azure Web App application in Visual Studio](https://docs.kentico.com/docsassets/k9/setting-up-kentico-in-azure-web-apps/DeployFromVS2015-Services.png "Creating an Azure Web App application in Visual Studio")
6. Click **Create**.

Visual Studio creates the Web App service. Continue with adjusting the configuration of the web.config file of your project, and deploying.

1. Right-click the created web app and select **View settings**.
2. Copy the connection string value and paste it to the **web.config** file of your project.

   ```xml

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

   ```

   Replace **YourServerName**, **YourDatabaseName**, **YourUsername** and **YourPassword** with your own values.

   > **Tip:** **Configuring the connection string after deployment**
   >
   > You can also configure the connection string through the [Azure Management Portal](https://portal.azure.com/) in **App Services ->** select a web app **-> Application settings** **-> Connection strings** section. To set the connection string for the web app, change the _defaultConnection_ name to _CMSConnectionString_.
3. Make sure that the sessionState mode is set to **InProc** in the web.config file.

   ```xml

   <sessionState mode="InProc" />

   ```

   > **Note:** 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/k9/running-kentico-on-microsoft-azure/storing-cache-and-session-state-data-in-azure-environment.md).
4. Right-click the project folder (CMSApp or CMS) in the Solution Explorer and select **Publish** (or **Publish Web App**).
   - A **Publish** dialog opens.
5. Click **Microsoft Azure App Service**.
6. Select the created web app from the drop-down list.
7. Click **OK**.
8. Leave the settings as they are.

   ![Deploying a Kentico project from Visual Studio using Web Deploy](https://docs.kentico.com/docsassets/k9/setting-up-kentico-in-azure-web-apps/KenticoVSWebAppsWebDeploy.png "Deploying a Kentico project from Visual Studio using Web Deploy")
9. Click **Publish**.
10. When the project is published and the website of your project is automatically opened in a browser, complete the database installation.

Perform the following final configurations:

- [Adjust the web hosting plan mode](https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/adjusting-the-web-hosting-plan-mode-on-azure-web-apps.md) on your web app.
- Configure the tier of your Azure SQL database according to our [recommendations](https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/recommendations-on-using-azure-sql-database-tiers.md).

## Uploading Kentico to Azure Web Apps over FTP

This scenario presumes that you already have a Kentico project installed on a local computer and you want to deploy it to the Azure Web App service over FTP. Uploading Kentico projects to Azure Web Apps through a FTP client is easy, but it can take a lot of time, so we recommend using a reliable client, for example [FileZilla](https://filezilla-project.org/).

You also need to create the Web Apps service first, through the Azure Management Portal.

### Creating Azure Web Apps through the Azure Management Portal

1. Open the [Azure Management Portal](https://portal.azure.com/).
2. Open **New** **-> Web + Mobile -> Web App + SQL -> Create**.
3. Enter the URL (name) of the web app.
4. Select the Azure subscription under which the Web App will be created.
5. Select an existing Resource Group or create a new one.
6. Select an existing [App Service plan](https://azure.microsoft.com/en-us/pricing/details/app-service/plans) or create a new one.
7. Select an existing SQL database and server or create a new one.
8. Click **Create**.

The system creates a new Web App service and an Azure SQL database.

### Uploading Kentico to Azure Web Apps over FTP

When you have created a Web App service, you can upload your Kentico project over an FTP connection. You can also upload just updated files over FTP after the deployment.

1. Open the [Azure Management Portal](https://portal.azure.com/).
2. Select your web app on the **App Services** tab.
3. Switch to the **Deployment credentials** tab.
4. Enter a user name and password and click OK.
5. Use the **FTP host name** and **Deployment / FTP User** information displayed on the application's **Overview**tab to configure your FTP client.

   ![Setting up an FTP connection to a created Web App](https://docs.kentico.com/docsassets/k9/setting-up-kentico-in-azure-web-apps/image2015-3-23204431.png "Setting up an FTP connection to a created Web App")
6. Copy the content of the **CMS** folder in your Kentico project to the _**site\wwwroot**_ folder on the Web App file system.

When the copying is finished, open the website and finish the database installation.

Perform the following final configurations:

- [Adjust the web hosting plan mode](https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/adjusting-the-web-hosting-plan-mode-on-azure-web-apps.md) on your web app.
- Configure the tier of your Azure SQL database according to our [recommendations](https://docs.kentico.com/k9/running-kentico-on-microsoft-azure/recommendations-on-using-azure-sql-database-tiers.md).
