> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/other-deployment-options/docker-and-on-premise/setup/microsoft-azure-setup/database-azure-cosmosdb.md).

# 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="/files/hZIXxh02VAWKYvGwbwaT" 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="/files/hQHDoZNWgEMETRsMuLYC" 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="/files/ow1jhd6v1obFT8l5FhxQ" 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: [Environment Variables](/doc/other-deployment-options/docker-and-on-premise/containers-environmental-variables.md)
{% 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="/files/WezPTjMtsSxnr9EBF1mD" 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="/files/SOPtkJrDeCrtx04pW1rZ" 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: [Environment Variables](/doc/other-deployment-options/docker-and-on-premise/containers-environmental-variables.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decisionrules.io/doc/other-deployment-options/docker-and-on-premise/setup/microsoft-azure-setup/database-azure-cosmosdb.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
