Azure CosmosDB Sink
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Send Data to an Azure CosmosDB instance
In the headers, you can optionally set the itemPartitionKey
/ ce-itemPartitionKey
property to specify the partition key for a specific item.
If you do not set the property in the header, you’ll need to use the static property itemPartitonKey.
There are two different mechanism of authentication SHARED_ACCOUNT_KEY
and AZURE_IDENTITY
, you could specify with credentialType property. If you’re using SHARED_ACCOUNT_KEY
accountKey property will be needed.
In case of AZURE_IDENTITY
selection, the DefaultAzureCredential will attempt to authenticate via the following mechanisms in the following order enviroment, Workload Identity, Managed Identity, Azure Developer CLI, IntelliJ, Azure CLI and Azure Powershell.
Configuration Options
The following table summarizes the configuration options available for the azure-cosmosdb-sink
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Container Name | Required The Azure Cosmos container name. | string | |||
Database Endpoint | Required Sets the Azure Cosmos database endpoint the component will connect to. | string | |||
Database Name | Required The Azure Cosmos database name. | string | |||
Account Key | The Azure Cosmos account Key. | string | |||
Credential Type | Determines the credential strategy to adopt. Enum values: * SHARED_ACCOUNT_KEY * AZURE_IDENTITY | string | SHARED_ACCOUNT_KEY | ||
Item Partition Key | Represents a partition key value in the Azure Cosmos DB database service. A partition key identifies the partition where the item is stored in. | string |
Dependencies
At runtime, the azure-cosmosdb-sink
Kamelet relies upon the presence of the following dependencies:
-
camel:azure-cosmosdb
-
camel:kamelet
-
camel:jackson
-
camel:core
Camel JBang usage
Prerequisites
-
You’ve installed JBang.
-
You have executed the following command:
jbang app install camel@apache/camel
Supposing you have a file named route.yaml with this content:
- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "kamelet:azure-cosmosdb-sink"
You can now run it directly through the following command
camel run route.yaml