---
title: Preparing the cloud environment
---

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

Before you start installing a Kentico project for Microsoft Azure, it can be convenient to configure the cloud environment using the [Microsoft Azure Management Portal](https://manage.windowsazure.com/) and create parts of the system you will need. It is not necessary to create all the parts in advance, but doing so all at once can save you time later.

To run a Kentico project on Microsoft Azure, you will need to create:

- [Azure Storage](#creating-a-microsoft-azure-storage)
- [Azure Cloud Service](#creating-a-microsoft-azure-cloud-service)

An Azure project can use either a standard hosted SQL Server or a cloud server. If you want to use the database service on Microsoft Azure platform, create also:

- [Azure SQL Server](#creating-a-microsoft-azure-sql-server)
- [Azure SQL Database](#creating-a-microsoft-azure-sql-database)

## Service location and affinity groups

We recommend that you configure an **affinity group** and use it for all data and cloud services you create. An affinity group ensures that the services assigned to it will be located in one datacenter and even close together within the particular datacenter.

To create an affinity group:

1. Click **Settings** in the left toolbar.
2. Select the **Affinity groups** tab.
3. Click **Add**.
4. Type the **Name** and **Description** for the affinity group.
5. Select the ideal **Region**.

   ![Creating an affinity group](https://docs.kentico.com/docsassets/k81/preparing-the-cloud-environment/Creating_affinity_groups.png "Creating an affinity group")
6. Finish the creation.

When creating new services, you can now assign them to the same affinity group to ensure their best performance.

> **Info:** Alternatively, you can also select the **same location** (for example, East US) for all created services.

## Creating a Microsoft Azure Storage

The [Microsoft Azure Storage](http://www.windowsazure.com/en-us/documentation/services/storage/) account will serve as a file system for your cloud based project. It provides access to the blob, queue and table services.

1. Click **New -> Data services -> Storage -> Quick create**.
2. Type a URL (name) of your new Azure storage, which is not currently in use.
3. Select the location for your storage. Use an affinity group or the same location for all created services.

   ![Creating new Azure storege](https://docs.kentico.com/docsassets/k81/preparing-the-cloud-environment/Creating_azure_storage.png "Creating new Azure storege")
4. Click **Create storage account**.

The portal creates the storage and you can see it in the list of storages.

## Creating a Microsoft Azure Cloud service

The [Microsoft Azure Cloud Service](http://www.windowsazure.com/en-us/manage/services/cloud-services/what-is-a-cloud-service/) provides an infrastructure for the code and configuration of your project.

1. Click **New -> Compute -> Cloud service -> Quick create**.
2. Type a URL (name) of your new Azure cloud service, which is not currently in use.
3. Select the location for your storage. Use an affinity group or the same location for all created services.

   ![Creating new Azure Cloud service](https://docs.kentico.com/docsassets/k81/preparing-the-cloud-environment/Creating_Azure_cloud_service.png "Creating new Azure Cloud service")
4. Click **Create cloud service**.

The portal creates the cloud service.

## Creating a Microsoft Azure SQL Server

The Azure SQL Server is a virtual server you can create in the cloud. You will need the server to create databases in it.

1. Select **SQL Databases** in the panel on the left.
2. Click **Servers**.
3. Click **Add**.
4. Specify a login name and password for the server.
5. Choose a region for the server's location. Use an affinity group or the same location for all created services..
6. Ensure, that the option **Allow Windows Azure services to access the server** is selected.
   - This option adds special firewall rules to allow your deployed Kentico project to access the server and its databases.

![Creating new Azure database server](https://docs.kentico.com/docsassets/k81/preparing-the-cloud-environment/Creating_azure_server.png "Creating new Azure database server")

7. Confirm the creation of the server.

The portal creates a new server. If you want to manage this server locally or use a local emulator, add firewall rules for IP ranges of your development and administration machines:

### Adding firewall rules for a server

1. Select the server.
2. Switch to the **Configure** tab.
3. Click the **Add to the allowed IP addresses** link or type the name of the rule and the IP address range of your development and administration machines.
4. Click **Save** in the bottom panel.

You have configured the server to be locally accessible.

## Creating a Microsoft Azure SQL Database

Create a new database on the virtual server, so that you can use it for Kentico database installation:

1. Click **New -> Data services -> SQL database -> Quick create**.
2. Type the name of the database.
3. Choose the Azure SQL database server you have already created.

   ![Creating new Azure SQL database](https://docs.kentico.com/docsassets/k81/preparing-the-cloud-environment/Creating_azure_database.png "Creating new Azure SQL database")
4. Click **Create SQL database**.

The portal creates your SQL database and you can now use it to [install the Kentico database](https://docs.kentico.com/k81/running-kentico-on-microsoft-azure/installing-the-database-for-an-azure-project.md) in it.
