# Database - Azure CosmosDB

After navigating to Azure Cosmos DB, hit Create. Choose **Azure Cosmos DB for MongoDB**. When prompted, select the Request unit (RU) based account. vCore cluster should also work but we've seen a number of issues arise when working with it.&#x20;

<figure><img src="https://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/rkhTez5lYKIdlj19mHAI/image.png" alt=""><figcaption><p>Cosmos DB for MongoDB -> Request unit (RU) database account</p></figcaption></figure>

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://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/qHzLdQ3vawPPmSkJrbdg/image.png" alt=""><figcaption><p>Basic settings</p></figcaption></figure>

Set your **Global Distributions** settings, i kept mine default. 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://content.gitbook.com/content/dv9UprVu3KjO5la255ws/blobs/8Gj0yOunb1mkdk9sjF4x/image.png" 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="warning" %}
If you use Cosmos DB you need to specify the DB\_TYPE environmental variable in your server container. More information here: [containers-environmental-variables](https://docs.decisionrules.io/doc/v1/on-premise-docker/containers-environmental-variables "mention")
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.decisionrules.io/doc/v1/on-premise-docker/microsoft-azure-setup/database-azure-cosmosdb.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
