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

# Connect your azure cosmos db to zeromagic in minutes

<img src="https://mintcdn.com/zeromagiclabsprivatelimited/7ggIiMFZ-j3juw2y/assets/blogs/connect-your-azure-cosmos-db-to-zeromagic-in-minutes/thumbnail.png?fit=max&auto=format&n=7ggIiMFZ-j3juw2y&q=85&s=e7afe2dec152f397bb95a715c080ee49" alt="thumbnail" width="1280" height="720" data-path="assets/blogs/connect-your-azure-cosmos-db-to-zeromagic-in-minutes/thumbnail.png" />

In this blog post, we'll guide you through connecting your external database, specifically Azure Cosmos DB, to the Zeromagic Platform in a matter of minutes. This seamless integration unlocks the power of Zeromagic's functionalities for your Cosmos DB data, allowing for efficient data management and automation.

## Steps to Connect Your Cosmos DB to Zeromagic

### 1. Log In and Navigate to Database

* Log in to the [Zeromagic Platform](https://console.zeromagic.cloud/).
* Go to your `Project Console`.
* Navigate to the `Database` section in the sidebar of the console.
* Click on `Create Database` to start the process of creating a new database.

<img src="https://mintcdn.com/zeromagiclabsprivatelimited/7ggIiMFZ-j3juw2y/assets/blogs/connect-your-azure-cosmos-db-to-zeromagic-in-minutes/db-section.png?fit=max&auto=format&n=7ggIiMFZ-j3juw2y&q=85&s=2abe6725e0cd676913370d828af4e998" alt="db-section" width="1911" height="800" data-path="assets/blogs/connect-your-azure-cosmos-db-to-zeromagic-in-minutes/db-section.png" />

### 2. Enter Database Source Information

* Provide a `Database Source Name` to help identify your database source on the platform.
* Select the appropriate `Database Provider` to connect to your database.

### 3. Toggle External Connection

* Enable the `External Connection` option to use an external connection for database integration.

### 4. Configure Database Connection

* **Cosmos Database Name:** Enter the exact name you assigned to your Cosmos DB database in Azure.

<img src="https://mintcdn.com/zeromagiclabsprivatelimited/h_DeJnPWvd8dA9lO/assets/images/cosmos-db-name.png?fit=max&auto=format&n=h_DeJnPWvd8dA9lO&q=85&s=bbb08cde960f7f16f6945ba071f3b2e7" alt="cosmos-db-name" width="660" height="342" data-path="assets/images/cosmos-db-name.png" />

* **Connection URI:** Locate and provide the unique connection URI for your Cosmos DB account. You can find this string within the Azure portal for your specific Cosmos DB instance. This URI acts as a secure access key.

* **Connection Key:** Select either the `PRIMARY KEY` or `SECONDARY KEY` as your connection method to access your Cosmos DB. It's recommended to use the secondary key for everyday operations and keep the primary key as a backup for critical situations.

<img src="https://mintcdn.com/zeromagiclabsprivatelimited/h_DeJnPWvd8dA9lO/assets/images/cosmos-config.png?fit=max&auto=format&n=h_DeJnPWvd8dA9lO&q=85&s=1060d817859993b0976ae53b63d68148" alt="cosmos-config" width="1600" height="733" data-path="assets/images/cosmos-config.png" />

### 5. Connect Database

Click on the `Connect Database` button to establish the connection between your external Cosmos DB and your Zeromagic project.

<img src="https://mintcdn.com/zeromagiclabsprivatelimited/h_DeJnPWvd8dA9lO/assets/images/create-ext-db.png?fit=max&auto=format&n=h_DeJnPWvd8dA9lO&q=85&s=efab075d31b476d8c0e7e0eaaaaaf93f" alt="cosmos-ext-db" width="738" height="685" data-path="assets/images/create-ext-db.png" />

### 6. Test Database Connection

Once you have established the connection, you can **test** the connection by clicking on `Test Connection`.

<img src="https://mintcdn.com/zeromagiclabsprivatelimited/7ggIiMFZ-j3juw2y/assets/blogs/connect-your-azure-cosmos-db-to-zeromagic-in-minutes/ext-db.png?fit=max&auto=format&n=7ggIiMFZ-j3juw2y&q=85&s=ac812f0235e7460440711c103b153f82" alt="cosmos-ext-db-conn" width="532" height="714" data-path="assets/blogs/connect-your-azure-cosmos-db-to-zeromagic-in-minutes/ext-db.png" />

<Note>
  **Connection Limitations:** This connection method is currently only compatible with Azure Cosmos DB for NoSQL databases.

  **Creating a Cosmos DB:** If you don't have an existing Cosmos DB account, you can follow the official Microsoft tutorial to set one up: [https://learn.microsoft.com/en-us/azure/cosmos-db/try-free](https://learn.microsoft.com/en-us/azure/cosmos-db/try-free)
</Note>

### References

[Try Azure Cosmos DB free](https://learn.microsoft.com/en-us/azure/cosmos-db/try-free)
