Skip to main content

Azure Cosmos DB Component

Manage databases, collections, and documents within Azure Cosmos DB.

Component key: azure-cosmos-db ·
· Changelog ↓

Description

Azure Cosmos DB is a Microsoft database service designed for handling various applications.

Manage databases, collections, and documents within Azure Cosmos DB.

API Documentation

This component was built using the Azure Cosmos DB (SQL) REST API.

Connections

Master Key

key: cosmosMasterKey

To authenticate this component using your Cosmos DB Core (SQL) API master key:

  1. Navigate to Azure Portal.
  2. Find your Cosmos DB account.
  3. In the left menu, under Settings, select Keys.
  4. Copy the Primary Key or Secondary Key.

You will also need the Cosmos DB account name (subdomain). For example, if your endpoint is: https://your-cosmos-account.documents.azure.com/

Then your account name is: your-cosmos-account

Use these values to configure the component connection.

InputNotesExample
Endpoint

Your Azure Cosmos DB account endpoint URL.

https://your-cosmos-account.documents.azure.com:443
Master Key

Your Azure Cosmos DB account master key. You can find this in the Azure Cosmos DB account settings.

YOUR_MASTER_KEY

Data Sources

Select Collection

Select a collection from the list of collections in a database | key: selectCollection | type: picklist

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase

Select Database

Select a database from the list of databases | key: selectDatabase | type: picklist

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.


Select Document

Select a document from the list of documents in a collection | key: selectDocument | type: picklist

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase

Actions

Create Collection

Create a new collection in a database | key: createCollection

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Partition Key Path

The path used as the partition key when creating the collection, e.g., /category.

/partition1
Throughput (RU/s)

The provisioned throughput for the collection in Request Units per second. <strong>Note:</strong> Serverless collections do not support setting throughput.

400
Example Payload for Create Collection
Loading…

Create Database

Create a new database in Cosmos DB | key: createDatabase

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Example Payload for Create Database
Loading…

Create Document

Create a new document in a collection | key: createDocument

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Document

The document as JSON string.

{
  "id": "doc1",
  "name": "Sample Document",
  "category": "example"
}
Partition Key Value

The value of the partition key for the document (required for partitioned collections).

electronics
Example Payload for Create Document
Loading…

Delete Collection

Delete a collection from a database | key: deleteCollection

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Example Payload for Delete Collection
Loading…

Delete Database

Delete a database from Cosmos DB | key: deleteDatabase

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Example Payload for Delete Database
Loading…

Delete Document

Delete a document from a collection | key: deleteDocument

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Document ID

The ID of the document.

doc1
ETag

The ETag value for optimistic concurrency control.

"00000000-0000-0000-0000-000000000000"
Partition Key Value

The value of the partition key for the document (required for partitioned collections).

electronics
Example Payload for Delete Document
Loading…

Get Collection

Get a specific collection by ID | key: getCollection

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Example Payload for Get Collection
Loading…

Get Database

Get a specific database by ID | key: getDatabase

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Example Payload for Get Database
Loading…

Get Document

Get a specific document by ID | key: getDocument

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Document ID

The ID of the document.

doc1
Partition Key Value

The value of the partition key for the document (required for partitioned collections).

electronics
Example Payload for Get Document
Loading…

List Collections

List all collections in a database | key: listCollections

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Example Payload for List Collections
Loading…

List Databases

List all databases in the Cosmos DB account | key: listDatabases

InputNotesExample
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Example Payload for List Databases
Loading…

List Documents

List all documents in a collection | key: listDocuments

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Continuation Token

Token for pagination to get the next set of results.

{"token":"kVEpAK0lM0gBAAAAAAAAAA==","range":{"min":"","max":"FF"}}
Database ID

The ID of the database.

myDatabase
Fetch All

If enabled, retrieves all documents by automatically fetching every page of results. This overrides 'Max Item Count' and ignores any 'Continuation Token'.

false
Max Item Count

Maximum number of items to return.

100
Example Payload for List Documents
Loading…

Update Document

Update an existing document in a collection | key: updateDocument

InputNotesExample
Collection ID

The ID of the collection.

myCollection
Connection

Azure Cosmos DB connection configured with endpoint URL and access key.

Database ID

The ID of the database.

myDatabase
Document

The document as JSON string.

{
  "id": "doc1",
  "name": "Sample Document",
  "category": "example"
}
Document ID

The ID of the document.

doc1
ETag

The ETag value for optimistic concurrency control.

"00000000-0000-0000-0000-000000000000"
Partition Key Value

The value of the partition key for the document (required for partitioned collections).

electronics
Example Payload for Update Document
Loading…

Changelog

2026-04-30

Updated spectral version

2026-01-20

Updated helper text for raw request action URL input to clarify usage with custom domains

2025-08-04

Initial release of the Azure Cosmos DB component with features for managing databases, collections, and documents