Azure Storage Files Sink
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Stable"
Uploads each message as a file to a directory of a file share in Azure Files, named after the file header.
Use it to drop files where applications or people that mount the share can read them, such as reports or exports. For blob containers, use azure-storage-blob-sink.
Input: the body is the content of the file: text, bytes or a stream. A Map fails: turn it into JSON text first, for example with json-serialize-action. The optional file header (or ce-file) is the name of the file; only its last part is used, so reports/2026/data.csv is written as data.csv in directoryName. Without it, the file gets a generated unique name.
Output: the message is unchanged.
Good to know: a file with the same name is replaced, unless fileExist says otherwise. Missing directories are created. Headers that start with CamelFile or CamelOverruleFile are removed from the message first, so they cannot change what the Kamelet does.
Configuration Options
The following table summarizes the configuration options available for the azure-storage-files-sink Kamelet:
| Property | Name | Description | Type | Default | Example |
|---|---|---|---|---|---|
Account Name | Required The name of the storage account, as shown in the Azure portal under Storage accounts. It is the first part of the address of the account, | string | mystorageaccount | ||
Share Name | Required The name of the file share in the storage account to write the files to. | string | documents | ||
Credential Type | How to log in to the storage account. Enum values: * SHARED_ACCOUNT_KEY * AZURE_IDENTITY * SHARED_KEY_CREDENTIAL * AZURE_SAS | string | SHARED_ACCOUNT_KEY | ||
Directory Name | The directory of the share to write the files to, such as | string | . | inbox/orders | |
If File Exists | What to do when a file with the same name is already in the directory. Enum values: * Override * Fail * Ignore | string | |||
Shared Access Key | An access key of the storage account, from the Azure portal: the storage account, then Security + networking, then Access keys. Used when | string |
Dependencies
At runtime, the azure-storage-files-sink Kamelet relies upon the presence of the following dependencies:
-
camel:azure-files
-
camel:kamelet
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-storage-files-sink" You can now run it directly through the following command
camel run route.yaml Azure Storage Files Sink Kamelet Description
Authentication methods
In this Kamelet, you can use these Azure authentication methods:
-
Plain Shared Account Key:
SHARED_ACCOUNT_KEY(default) -
Azure Identity mechanism:
AZURE_IDENTITY -
Shared key credentials:
SHARED_KEY_CREDENTIAL -
Azure SAS:
AZURE_SAS
The order of evaluation for AZURE_IDENTITY is the following:
-
Enviroment
-
Workload Identity
-
Managed Identity
-
Azure Developer CLI
-
IntelliJ
-
Azure CLI
-
Azure Powershell
For more information, see the Azure Identity documentation
Optional Headers
In the headers, you can set the file / ce-file property to specify the filename to upload. If you do not set it, the file gets a generated unique name.
The value is reduced to a single file name before use: any directory component is dropped, so reports/2026/data.csv is stored as data.csv. The file is always written inside the configured directory.
Example that Never Replaces a File
- route:
from:
uri: "kamelet:timer-source"
parameters:
message: "report"
period: 60000
steps:
- setHeader:
name: file
simple: "report-$\{date:now:yyyyMMdd}.txt"
- to:
uri: "kamelet:azure-storage-files-sink"
parameters:
accountName: "mystorageaccount"
shareName: "documents"
sharedKey: "the-access-key"
directoryName: "reports"
fileExist: "Fail" The first message of the day writes reports/report-20261118.txt. The later messages of the same day fail, and the file is kept. With Ignore instead of Fail, they are dropped without an error.