Cosmos DB Connector
The high-performance Cosmos DB Connector provides read/write capabilities within your application, allowing you to perform numerous Cosmos DB operations with minimal coding or even no-coding at all. Integrate Cosmos DB data into applications such as SSIS, SQL Server, any ODBC-compatible application, or even directly within a programming language using this connector.
Download for SSIS Download for SQL Server and ODBC Documentation
Integrate Cosmos DB with these applications
Actions supported by Cosmos DB Connector
Cosmos DB Connector supports following actions for REST API integration:
Create a document in the container
Description
Insert JSON document in Cosmos DB Container.
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
-
Document
-
Partition Key Value (default is supplied Id)
-
Enable Upsert Mode (update if document found)
Input Fields
You can provide the following fields to this action:
-
PartitionKey
-
Document
Output Fields
The following fields are returned after calling this action:
-
id
-
_rid
-
_ts
-
http_status
Visit documentation for more information.
Create Permission Token for a User (One Table)
Description
Create a new user which you can later use to create permission set and obtain resource token.
Parameters
You can provide the following parameters to this action:
-
Permission Name (e.g. read_orders)
-
User Name (Case-Sensitive)
-
PermissionMode
-
Table (Add Permission for this)
-
Database Name (keep blank to use default) Case-Sensitive
-
ExpiresInSecond
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
PermissionMode
-
Resource
-
Token
Visit documentation for more information.
Create User for Database
Description
Create a new user which you can later use to create permission set and obtain resource token.
Parameters
You can provide the following parameters to this action:
-
Database Name (keep blank to use default) Case-Sensitive
-
RequestBody
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
Permissions
Visit documentation for more information.
Delete a Document by Id
Description
Deletes a Document by Id.
Parameters
You can provide the following parameters to this action:
-
Document Id
-
Table Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
-
EnableCrossPartition
-
Partition Key Value (default is supplied Id)
Input Fields
You can provide the following fields to this action:
-
Id
Output Fields
The following fields are returned after calling this action:
-
Id
-
Status
-
Table
-
StatusCode
Visit documentation for more information.
Get All Documents for a Table
Description
Gets all documents for a Table.
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
-
Max Rows Per Page (Adjust for Speed)
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
N/A
Visit documentation for more information.
Get All Users for a Database
Description
Gets all users for a Database.
Parameters
You can provide the following parameters to this action:
-
Database Name (keep blank to use default) Case-Sensitive
-
Max Rows Per Page (Adjust for Speed)
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
Permissions
Visit documentation for more information.
Get Database Information by Id or Name
Description
Gets a database by its Id.
Parameters
You can provide the following parameters to this action:
-
Database Name (keep blank to use default) Case-Sensitive
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
Collections
-
Users
Visit documentation for more information.
Get Document by Id
Description
Gets Document by Id.
Parameters
You can provide the following parameters to this action:
-
Document Id
-
Table Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
-
EnableCrossPartition
-
Partition Key Value (default is supplied Id)
-
ConsistencyLevel
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
N/A
Visit documentation for more information.
Get List of Databases
Description
Gets a list of the databases in the current database account.
Parameters
You can provide the following parameters to this action:
-
Max Rows Per Page (Adjust for Speed)
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
Collections
-
Users
Visit documentation for more information.
Get List of Tables
Description
Gets a list of the tables in the database. (Tables are also called 'containers' or 'collections').
Parameters
You can provide the following parameters to this action:
-
Database Name (keep blank to use default) Case-Sensitive
-
Max Rows Per Page (Adjust for Speed)
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
UniqueKeys
-
IndexingPolicyIndexingMode
-
IndexingPolicyAutomatic
-
IndexingPolicyIncludedPaths
-
IndexingPolicyExcludedPaths
-
ConflictResolutionMode
-
ConflictResolutionPath
-
ConflictResolutionProcedure
-
GeospatialConfigType
-
PartitionKeyPaths
-
PartitionKeyKind
-
PartitionKeyVersion
-
Documents
-
StoredProcedures
-
Triggers
-
UserDefinedFunctions
-
Conflicts
Visit documentation for more information.
Get table information by Id or Name
Description
Gets a table by its Id. (Tables are also called 'containers' or 'collections').
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
UniqueKeys
-
IndexingPolicyIndexingMode
-
IndexingPolicyAutomatic
-
IndexingPolicyIncludedPaths
-
IndexingPolicyExcludedPaths
-
ConflictResolutionMode
-
ConflictResolutionPath
-
ConflictResolutionProcedure
-
GeospatialConfigType
-
PartitionKeyPaths
-
PartitionKeyKind
-
PartitionKeyVersion
-
Documents
-
StoredProcedures
-
Triggers
-
UserDefinedFunctions
-
Conflicts
Visit documentation for more information.
Get table partition key ranges
Description
Gets Partition Key Ranges for a table. This is useful for query if you want to minimize scan to specific partition (Tables are also called 'containers' or 'collections').
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
N/A
Visit documentation for more information.
Get User by Id or Name
Description
Gets database user information for a specific Id.
Parameters
You can provide the following parameters to this action:
-
User Name (Case-Sensitive)
-
Database Name (keep blank to use default) Case-Sensitive
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
Id
-
ResourceId
-
LastUpdated
-
ETag
-
Permissions
Visit documentation for more information.
Query documents using Cosmos DB SQL query language
Description
Gets data based on the specified SQL query.
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
SQL Query
-
Database Name (keep blank to use default) Case-Sensitive
-
Allow Query Scan
-
Allow Cross Partition Query
-
Cross Partition Key Range Id
-
Max Rows Per Page (Adjust for Speed)
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
N/A
Visit documentation for more information.
Update Document in the Container
Description
Update full or part of the document in Cosmos DB Container.
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
Document Id
-
Database Name (keep blank to use default) Case-Sensitive
-
Document
-
Partition Key Value (default is supplied Id)
Input Fields
You can provide the following fields to this action:
-
RequestMethod
-
PartitionKey
-
Id
-
Document
Output Fields
The following fields are returned after calling this action:
-
id
-
_rid
-
_ts
-
http_status
Visit documentation for more information.
Upsert a document in the container
Description
Insert JSON document in Cosmos DB Container.
Parameters
You can provide the following parameters to this action:
-
Table Name (Case-Sensitive)
-
Upsert
-
Database Name (keep blank to use default) Case-Sensitive
-
Document
-
Partition Key Value (default is supplied Id)
Input Fields
You can provide the following fields to this action:
-
PartitionKey
-
Document
Output Fields
The following fields are returned after calling this action:
-
id
-
_rid
-
_ts
-
http_status
Visit documentation for more information.
Make Generic API Request
Description
This is generic endpoint. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.
Parameters
You can provide the following parameters to this action:
-
Url
-
Body
-
IsMultiPart
-
Filter
-
Headers
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
N/A
Visit documentation for more information.
Make Generic API Request (Bulk Write)
Description
This is a generic endpoint for bulk write purpose. Use this endpoint when some actions are not implemented by connector. Just enter partial URL (Required), Body, Method, Header etc. Most parameters are optional except URL.
Parameters
You can provide the following parameters to this action:
-
Url
-
IsMultiPart
-
Filter
-
Headers
Input Fields
You can provide the following fields to this action:
-
N/A
Output Fields
The following fields are returned after calling this action:
-
N/A
Visit documentation for more information.