---
title: Installing the database for Azure projects
---

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

After you have [deployed your Azure project](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/running-kentico-in-azure-cloud-services/deploying-azure-projects-to-cloud-services.md) to the cloud, continue to installing the database. Kentico projects hosted in Azure can use any type of SQL database, hosted either on a standard SQL Server or in the cloud. This topic describes the installation on an SQL Azure server.

If you have already configured the connection string for your project, you can skip the **Generating the connection string** and **Setting the connection strings** sections.

## Installing a database on an Azure SQL server

To install the database on an Azure SQL server, use the system to generate the connection string, paste the connection string as a value to your cloud service and let the system install the database.

### Generating the connection string

1. Access the website of your deployed Azure project. 

   - You can find the URL in **Cloud services ->** select your service **-> Overview**under Site URL.

     ![Locating the Site URL property in the Azure portal](https://docs.kentico.com/docsassets/k11/installing-the-database-for-azure-projects/CloudServiceSiteUrl.png "Locating the Site URL property in the Azure portal")
2. Specify the target Azure SQL server (created when [Preparing 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)) and supply the credentials for the server:
   - **SQL Server name or IP address** – enter your Azure SQL server name, you can find all your servers listed under **SQL databases ->**select your database**-> Overview** under **Server name**. The standard format is _.database.windows.net_.

     ![Specifying the Azure SQL server name and its credentials](https://docs.kentico.com/docsassets/k11/installing-the-database-for-azure-projects/CloudServiceDatabaseInstall.png "Specifying the Azure SQL server name and its credentials")
3. Click **Next**.
4. Enter the name of the SQL database (created when [Preparing 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)).
5. Choose whether you want to **Create Kentico CMS database objects**.
   - Select this option if you are installing into an empty database.
   - Clear this option if the existing database already contains Kentico objects (tables, stored procedures, views).
6. Click **Next**.
7. Copy the connection string **value** into the clipboard.

   ![Copying the connection string for the ServiceConfiguration.cscfg file](https://docs.kentico.com/docsassets/k11/installing-the-database-for-azure-projects/DB_connection_strings.png "Copying the connection string for the ServiceConfiguration.cscfg file")

### Setting the connection strings

1. Open the [Azure Management Portal](https://portal.azure.com/) in another browser tab.
2. Navigate to **Cloud services ->** select your service\*\*-> Configuration\*\*.
3. Paste the copied connection string value into the fields of the **CMSConnectionString** setting for the CMSApp role and also the SmartSearchWorker role if you are using it.

   ![Setting role connection strings](https://docs.kentico.com/docsassets/k11/installing-the-database-for-azure-projects/CloudServiceSettingConnectionString.png "Setting role connection strings")
4. Click **Save**.
5. Close the original window with the database installation.

You have now connected your Cloud Service application to the created Azure SQL database.

We recommend that you configure the connection string in your local Azure project as well to ease future deployments:

1. Open your Azure project in Visual Studio.
2. Double-click the **CMSApp** role.
3. Switch to the **Settings** tab and select **Cloud** as Service Configuration.
4. Paste the connection string as a value for the **CMSConnectionString** key.
5. Repeat for the **SmartSearchWorker** role if you are using it.

Now you will not have to set the connection string in your local project the next time you deploy your project to the cloud.

### Finishing the database installation

1. Open your project's website again (_.cloudapp.net_).
   - The database installation automatically resumes.
2. Confirm the target database by clicking **Next**.
   - The installer now installs the database for your project.
3. Enter a license key for the domain.
   - Staging deployments are automatically covered by any other valid license, so you do not have to request a separate license for staging deployments. However, this applies only if you use the recommended configuration, which is to use separate databases for live and staging environment.
4. Click **Next**.
5. Choose an initial website to install:
   - **Choose a starter site** – choose from the supplied sample sites to try out the system's functionality, or use them as a template for custom development. We recommend the _Dancing Goat_ or _Corporate Site_ sample sites.
   - **Create a new site or import an existing Kentico site** - redirects you to the _Sites_ application within the Kentico interface.
     - Use the [New site wizard](https://docs.kentico.com/k11/configuring-kentico/managing-sites/installing-new-sites.md) if you wish to create a new site from scratch.
     - Allows you to [import sites](https://docs.kentico.com/k11/deploying-websites/exporting-and-importing-sites/importing-a-site-or-objects.md) if you have already created a website using Kentico and you want to import it to the new installation.

The installer creates your chosen website and finishes the installation. See our [Recommendations on using Azure SQL Database tiers](https://docs.kentico.com/k11/running-kentico-on-microsoft-azure/recommendations-on-using-azure-sql-database-tiers.md) and adjust the tier of your database to suit your project demands.

If you continue to your new website, you can sign in to the administration interface.

> **Tip:** **To sign-in to our sample starter sites, use the following credentials:**
>
> User name: _administrator_\
> Password: (blank password)
