> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prod.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure CosmosDB

> Build apps with read and write access to a CosmosDB database

## Setting up CosmosDB

### 1. Add integration

Select **CosmosDB** from the&#x20;
**integrations page**.

### 2. Configure settings

Fill out the form with the following settings:

| Setting | Required | Description |
| - | - | - |
| Name | ✓ | Name that will be displayed to users when selecting this integration in Prod AI |
| Host | ✓ | Hostname or IP address to connect to |
| Port | ✓ | Port to use when connecting to CosmosDB |
| Database ID | ✓ | ID of database to connect to |
| Master Key | ✓ | The Master Key to access the database |

### 3. Test and save

Click **Test Connection** to check that Prod AI can connect to the data source.

On Dedicated Cloud, allowlist your [Prod AI data plane IP addresses](https://docs.prod.ai/deployment/security/overview.md#ip-addresses) to connect to your database. On Managed BYOC, connect over private networking within your AWS account.

After connecting successfully, click **Create** to save the integration.

### 4. Set data tags

Optionally, configure different data tags for [separate development environments](https://docs.prod.ai/development-lifecycle/build/data-tags.md).

**CosmosDB connected!**
You can now build
[apps](https://docs.prod.ai/coding-agents/apps.md) and [agents](https://docs.prod.ai/coding-agents/agents.md) with CosmosDB.

## Creating CosmosDB steps

When using CosmosDB steps, there are 2 options:

1. [SQL queries](#sql-queries)
2. [Single object actions](#single-object-actions)

### SQL queries

Write SQL queries to interact with your CosmosDB instance directly.

### Single object actions

Use **single object actions** to perform CRUD actions on a single object. Pass in an object of data in the **Item Body**. Actions supported include:

* Create a single object
* Read a single object
* Upsert a single object
* Replace a single object
* Delete a single object

## Troubleshooting

Check out our guide on [common errors across database integrations](https://docs.prod.ai/integrations/troubleshooting/troubleshooting-databases.md), in addition to [common CosmosDB connection issues](https://learn.microsoft.com/en-us/azure/cosmos-db/postgresql/howto-troubleshoot-common-connection-issues). If you are encountering an error that you don't see in the guide, or the provided steps are insufficient to resolve the error, please contact us at [support@prod.ai](mailto:support@prod.ai).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.