Azure Cosmos DB
The Azure Cosmos DB piece in ZBrain Flow provides integration with Microsoft's globally distributed, multi-model database service, allowing you to interact with your NoSQL data directly from your workflows. This powerful connector enables you to create, read, update, and delete documents without manual intervention. With Azure Cosmos DB integration, you can build automations that store application data, retrieve information based on queries, maintain document collections, and synchronize information between your database and other business systems. This piece is ideal for organizations looking to incorporate cloud-based NoSQL database operations into their automated processes, enabling scalable, high-performance data storage and retrieval for a wide range of applications.
How to Use Azure Cosmos DB in ZBrain Flow
Select Azure Cosmos DB as Your Connection
Click on the '+' button in the Flow and search for Azure Cosmos.
Select Azure Cosmos.
Decide on the action you need, then select it. ZBrain Flow provides several options:
Create Item β Add new items to your Cosmos DB collections.
Read Item β Retrieve specific documents using their IDs.
List Items β Retrieve multiple documents from a collection.
Update Item β Modify existing documents by their ID.
Delete Item β Remove documents from your collections.
How to Connect to Azure Cosmos DB
Before using any Azure Cosmos DB actions in ZBrain Flow, you'll need to set up a connection to your database. This is a one-time setup that will allow you to access your NoSQL data securely.
To create your Azure Cosmos DB connection:
From any Azure Cosmos action, click on the connection dropdown and select 'Create connection'.
In the popup window that appears, you'll need to:
Enter a descriptive 'Connection Name' to identify this Cosmos DB connection
In the 'Cosmos DB Endpoint' field, enter the URL of your Cosmos DB account
In the 'Cosmos DB Key' field, enter your primary or secondary access key
In the 'Database Name' field, enter the name of the specific database you want to access
In the 'Container Name' field, enter the name of the container (collection) within that database
Click 'Save' to store this connection
To obtain your Azure Cosmos DB credentials:
Log in to the Azure Portal
Navigate to your Azure Cosmos DB account
Go to the "Keys" section in the left sidebar
Copy the URI and Primary Key values
On the Azure portal βOverviewβ page for your Azure Cosmos DB account, note the database and container names.
How to Add Documents to Cosmos DB Collections
Configuration Steps:
Connect to your Azure Cosmos DB following the steps in the "How to Connect to Azure Cosmos DB" section.
In the 'Item' field, enter a JSON object representing the document you want to create.
How to Retrieve Specific Documents from Cosmos DB
Configuration Steps:
Connect to your Azure Cosmos DB following the steps in the "How to Connect to Azure Cosmos DB" section.
In the 'Item ID' field, enter the unique identifier of the document you want to retrieve.
How to List Items in Cosmos DB
Configuration Steps:
Connect to your Azure Cosmos DB following the steps in the "How to Connect to Azure Cosmos DB" section.
In 'Field', optionally enter a document property name to filter results. For example: "category", "status", or "location." Leave empty to retrieve all documents in the container.
In the 'Value' field, optionally enter the specific value to match in the field. For example: "electronics", "active", or "New York"
In the 'Operator' field, optionally specify the comparison method. For example, : '=', '>', '<', '>=', '<=', '!='
How to Update Items in Cosmos DB
Configuration Steps:
Connect to your Azure Cosmos DB following the steps in the "How to Connect to Azure Cosmos DB" section.
In the 'Item ID' field, enter the unique identifier of the document you want to modify. This corresponds to the 'id' property of the document.
In the 'Item Data' field, enter a JSON object containing the fields and values you want to update.
How to Remove Documents from Cosmos DB Collections
Configuration Steps:
Connect to your Azure Cosmos DB following the steps in the "How to Connect to Azure Cosmos DB" section.
In the 'Item ID' field, enter the unique identifier of the document you want to delete.
Last updated