# Database - Azure CosmosDB

After navigating to Azure Cosmos DB, hit Create. Choose **Azure DocumentDB (with MongoDB compatibility)**.&#x20;

{% hint style="info" %}
From version 1.21.0, we recommend using the Azure DocumentDB (formerly vCore) type instead of RU-based type for new environments, following Microsoft’s own recommendation.
{% endhint %}

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FIkUDIbwlWG79f8JQwNQx%2Fimage.png?alt=media&#x26;token=a2f16ea7-cb89-4314-a83a-691f4ab87957" alt=""><figcaption><p>DocumentDB (with MongoDB Compatibility)</p></figcaption></figure>

## Azure DocumentDB (formerly vCore)

Assign your resource group, give the cluster a name, choose a location and choose the cluster tier and version if necessary.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FqvKhhMdsTy4TIERAtlYk%2Fimage.png?alt=media&#x26;token=6eefaf3b-0302-4c2e-8c9b-85258415d78f" alt=""><figcaption><p>Basic settings</p></figcaption></figure>

Next go to the Networking tab and fill in the settings.&#x20;

{% hint style="warning" %}
It is recommended to use a Private Endpoint connection but for hassle free non-Prod environment deployments a Public Endpoint is also an option.
{% endhint %}

Create your private endpoint, making sure it shares the same virtual network as your future server container.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FeE4mpkrhYaUAlpdglQYP%2Fimage.png?alt=media&#x26;token=cbeb4308-1ab0-4bcd-a239-6272d2a5669c" alt=""><figcaption><p>Networking settings and Private Endpoint</p></figcaption></figure>

For the Global distribution, Encryption and Tags choose whatever fits your use-case. Review the account and create.

{% hint style="danger" %}
If you use Azure DocumentDB (formerly called vCore-based Cosmos DB) you need to specify the **DB\_TYPE** environmental variable in your server container with value **COSMOSDB\_VCORE**. More information here: [containers-environmental-variables](https://docs.decisionrules.io/doc/other-deployment-options/docker-and-on-premise/containers-environmental-variables "mention")
{% endhint %}

## RU-based

Assign your resource group, give the account a name, choose a location and choose the **Serverless** capacity mode.

{% hint style="info" %}
Serverless Capacity mode has much lower operating costs compared to the Provisioned Throughput option. If for whatever reason you decide to go with the Provisioned Throughput option anyways, make sure to set the limit to a minimum of 12000 RUs.
{% endhint %}

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FHqyeaaq34IkytDoSgzCe%2Fimage.png?alt=media&#x26;token=4d8e0f6c-18e0-4d2a-a5f7-4a3888d25e71" alt=""><figcaption><p>Basic settings</p></figcaption></figure>

Set your Global Distributions settings if needed. Next go to the Networking tab and fill in the settings.&#x20;

{% hint style="warning" %}
It is recommended to use a Private Endpoint connection but for hassle free non-Prod environment deployments a Public Endpoint is also an option.
{% endhint %}

Create your private endpoint, making sure it shares the same virtual network as your future server container.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FqsaBMMa4vv2bSqxGb8Bn%2Fimage.png?alt=media&#x26;token=6f7d7983-1079-490b-84a5-e69352e02e40" alt=""><figcaption><p>Networking settings and Private Endpoint</p></figcaption></figure>

For the Backup Policy, Encryption and Tags choose whatever fits your use-case. Review the account and create.

#### Where to find a connection string

After the database account has been created, navigate to Settings / Connection strings. The connection string can be found under **Primary/Secondary connection string**.

{% hint style="danger" %}
If you use RU-based Cosmos DB you need to specify the **DB\_TYPE** environmental variable in your server container with value **COSMOSDB**. More information here: [containers-environmental-variables](https://docs.decisionrules.io/doc/other-deployment-options/docker-and-on-premise/containers-environmental-variables "mention")
{% endhint %}
