Azure CosmosDB binding spec

Detailed documentation on the Azure CosmosDB binding component

Component format

To setup Azure CosmosDB binding create a component of type bindings.azure.cosmosdb. See this guide on how to create and apply a binding configuration.

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: <NAME>
  5. namespace: <NAMESPACE>
  6. spec:
  7. type: bindings.azure.cosmosdb
  8. version: v1
  9. metadata:
  10. - name: url
  11. value: https://******.documents.azure.com:443/
  12. - name: masterKey
  13. value: *****
  14. - name: database
  15. value: db
  16. - name: collection
  17. value: collection
  18. - name: partitionKey
  19. value: message

Warning

The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.

Spec metadata fields

FieldRequiredBinding supportDetailsExample
urlYOutputThe CosmosDB urlhttps://******.documents.azure.com:443/
masterKeyYOutputThe CosmosDB account master key“master-key”
databaseYOutputThe name of the CosmosDB database“OrderDb”
collectionYOutputThe name of the container inside the database.“Orders”
partitionKeyYOutputThe name of the partitionKey to extract from the payload and is used in the container“OrderId”, “message”

For more information see Azure Cosmos DB resource model.

Binding support

This component supports output binding with the following operations:

  • create

Last modified August 2, 2021 : Fix Java SDK link (#1695) (2c67fd1)