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

以上示例将 Secret 明文存储。 更推荐的方式是使用 Secret 组件, here

Spec metadata fields

字段RequiredBinding 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.

Output bindings

字段名为 ttlInSeconds

  • create

相关链接

Last modified January 1, 0001