---
title: Deploying MVC applications
---

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

## Using staging for the content of MVC applications

You can use [Staging](https://docs.kentico.com/k11/deploying-websites/content-staging.md) to transfer page content and other objects, which were created in the administration UI, between different instances of Kentico, even when using a separate [MVC application](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/starting-with-mvc-development.md) for the presentation of the website.

For MVC websites, every "instance" within the staging topology must consist of the following components:

- The Kentico application used to store data and manage content
- The MVC application used to generate the design of the live website (or multiple MVC applications running in a web farm)
- One Kentico database shared by the applications

The steps required to set up the staging are the same as with standard Kentico projects. You need to [configure the staging](https://docs.kentico.com/k11/deploying-websites/content-staging/configuring-content-staging.md) between the Kentico applications, which then provide the transfer of data between the databases of the given staging instances. The MVC applications within individual staging instances use the data of the related Kentico application to present the website.

## Running MVC applications on Microsoft Azure

You can run your MVC application, together with the Kentico application, on [Microsoft Azure](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure.md). You can make use of either [Azure Web Apps](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps.md) or [Azure Cloud Services](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services.md).

### Running MVC applications on Azure Web Apps

1. Perform the [initial set up](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/starting-with-mvc-development.md) of your MVC application.
2. [Deploy the Kentico database to Azure](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/deploying-existing-kentico-projects-to-azure-web-apps.md#part-1---deploying-the-database-to-azure).
3. Deploy the Kentico application and MVC application to [Azure Web Apps](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/deploying-existing-kentico-projects-to-azure-web-apps.md). Perform the following tasks for both applications:

   1. [Create Azure Web Apps service from Visual Studio](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/deploying-existing-kentico-projects-to-azure-web-apps.md#part-2---creating-azure-web-apps-from-visual-studio).
   2. [Deploy the project to Azure Web Apps](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-web-apps/deploying-existing-kentico-projects-to-azure-web-apps.md#part-3---deploying-projects-to-azure-web-apps).
4. Edit () your [site](https://docs.kentico.com/k11/configuring-kentico/managing-sites.md) in Kentico and add a [domain alias](https://docs.kentico.com/k11/configuring-kentico/managing-sites/setting-domain-names-for-sites.md#adding-domain-aliases) and [presentation URL](https://docs.kentico.com/k11/configuring-kentico/managing-sites/setting-domain-names-for-sites.md) for your MVC application.

### Running MVC applications on Azure Cloud Services

#### Configuring the Kentico application project

1. Deploy the Kentico application to [Azure Cloud Services](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services.md):

   1. [Prepare the cloud environment](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/preparing-the-azure-cloud-environment.md).
   2. [Install Kentico as an Azure project](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/installing-kentico-azure-projects.md).
   3. [Configure the Azure project](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/configuring-kentico-azure-projects-for-cloud-services.md).
   4. [Deploy the project to Cloud Services](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/deploying-azure-projects-to-cloud-services.md).
   5. [Install the database for your project](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/installing-the-database-for-azure-projects.md).
2. Once deployed, edit () your [site](https://docs.kentico.com/k11/configuring-kentico/managing-sites.md) and add a [domain alias](https://docs.kentico.com/k11/configuring-kentico/managing-sites/setting-domain-names-for-sites.md#adding-domain-aliases) and [presentation URL](https://docs.kentico.com/k11/configuring-kentico/managing-sites/setting-domain-names-for-sites.md) for your MVC application.

The Kentico application now runs on Azure Cloud Services. You can continue to configure your MVC application.

#### Configuring the MVC application project

Prepare your MVC application:

1. Perform the [initial set up](https://docs.kentico.com/k11/developing-websites/developing-sites-using-asp-net-mvc/starting-with-mvc-development.md) of your MVC application.
2. Open the MVC solution in Visual Studio.
3. Build your solution.
4. In the toolbar of Solution Explorer, click **Show All Files**.
5. Right-click the following folders and select **Include In Project**:

   - _CMSDependencies_
   - _CMSResources_
6. In the properties of all _resx_ files in the _CMSResources_ folder, set the **Build Action** property to **Content**.\
   Setting the property value to _Content_ tells the publishing process to copy the file as-is to the destination.

Configure the Azure Cloud Service project for deployment in your MVC application:

1. Add an **Azure Cloud Service** project to your solution:

   1. In Visual Studio, right-click the MVC solution and select **Add->New project...**
   2. In the _Add New Project_ dialog, select **.NET Framework**version 4.6.
   3. Choose the **Azure Cloud Service** project template and click **OK**.
   4. In the _New Microsoft Azure Cloud Service_ dialog, double-click**ASP.NET Web Role** to add it to a list of Microsoft Azure Cloud services and click **OK**.
   5. In the _New ASP.NET Project_ window, click **Cancel**(do not choose a template).
2. Add a **Web Role Project** to the Azure Cloud Service:
   1. In the _Azure Cloud Service_ project, right-click **Roles** and select**Add ->Web Role Project in solution**.
   2. In the _Associate with Role Project_ dialog, select your **MVC application** project and click **OK**.
3. Copy the role settings from the Kentico Azure project's _CMSApp_ role to the MVC application project's new web role:

   1. In both Kentico and MVC solutions, open the **Properties** of their Web Role Projects.
   2. Switch to the **Settings** tab.
   3. Set **Service Configuration** to _All Configurations_.
   4. Click **Add Setting** and copy the Name and Value of a setting from one role to the other.
   5. Repeat the previous step for all settings.
   6. Save the changes.
4. Right-click the **Azure Cloud Service** project and select **Publish...**
   1. On the **Settings** tab, use the same **Storage account** that you are using for the Kentico application.
   2. Click **Next**.
   3. Verify the configuration in the _Summary_.
   4. Click**Publish**.
