> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/azure-data-lake/uploadfiles.md).

# UploadFiles

Upload files to Azure Data Lake.

Task version: 2.0.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.AzureDataLake/tree/main/Frends.AzureDataLake.UploadFiles>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Source : `Source`                                 | <p>Specify source files parameters</p><p><br>Default: <code>-</code><br>Example: <code>{ SourceDirectory = "c:\temp", SourceFilePattern = "\*.csv" }</code></p>                                                                                                                                                                                                                                            |
| Source.SourceDirectory : `String`                 | <p>Upload all files from the given directory.</p><p><br>Default: <code>-</code><br>Example: <code>c:\temp</code></p>                                                                                                                                                                                                                                                                                       |
| Source.SourceFilePattern : `String`               | <p>The search string is used to match against the names of files in the path.</p><p>This parameter can contain a combination of valid literal path and wildcard (\* and ?) characters, but it doesn't support regular expressions</p><p><br>Default: <code>-</code><br>Example: <em><code>.</code></em><code>, Search\*.\*, \*.xml, foobar.txt</code></p>                                                  |
| Destination : `Destination`                       | <p>Specify destination Data Lake parameters</p><p><br>Default: <code>-</code><br>Example: <code>{ ConnectionMethod = ConnectionMethod.ConnectionString, ContainerName = "examplecontainer", DestinationFolderName = "uploads" }</code></p>                                                                                                                                                                 |
| Destination.ConnectionMethod : `ConnectionMethod` | <p>Connection method to be used to connect to Azure Data Lake.</p><p>Possible values:</p><ul><li><code>ConnectionString</code>: Connection method to be used to connect to Azure Data Lake.</li><li><code>OAuth2</code>: Connection method to be used to connect to Azure Data Lake.</li></ul><p><br>Default: <code>ConnectionString</code><br>Example: <code>ConnectionMethod.ConnectionString</code></p> |
| Destination.ContainerName : `String`              | <p>Name of the Azure Data Lake container.</p><p>Task will convert all letters to lowercase.</p><p><br>Default: <code>-</code><br>Example: <code>examplecontainer</code></p>                                                                                                                                                                                                                                |
| 🗝Destination.ConnectionString : `String`         | <p>Connection string for Azure Data Lake.</p><p><br>Default: <code>-</code><br>Example: <code>DefaultEndpointsProtocol=https;AccountName=accountname;AccountKey=Pdlrxyz==;EndpointSuffix=core.windows.net</code></p>                                                                                                                                                                                       |
| Destination.StorageAccountName : `String`         | <p>Name of the Azure storage account.</p><p><br>Default: <code>-</code><br>Example: <code>storage</code></p>                                                                                                                                                                                                                                                                                               |
| Destination.ApplicationID : `String`              | <p>Application (Client) ID of Azure AD Application.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-qwer3h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                 |
| Destination.TenantID : `String`                   | <p>Tenant ID of Azure Tenant.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-qwer3h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                       |
| 🗝Destination.ClientSecret : `String`             | <p>Client Secret of Azure AD Application.</p><p><br>Default: <code>-</code><br>Example: <code>Password!</code></p>                                                                                                                                                                                                                                                                                         |
| Destination.DestinationFolderName : `String`      | <p>Name of the blob folder. If left empty, file will be uploaded directly to container.</p><p><br>Default: <code>-</code><br>Example: <code>ExampleDir</code></p>                                                                                                                                                                                                                                          |
| Overwrite : `Boolean`                             | <p>How the existing file will be handled.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                          |
| UploadFilesRecursively : `Boolean`                | <p>True: Upload all files matching pattern, even in nested directories.</p><p>False: Upload files matching pattern, which are only directly in Source Directory</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                     |
| Close : `Boolean`                                 | <p>Specifies whether the uploaded file should be finalized (closed) after upload.</p><p>When true, it triggers a "final update" event in Azure Storage Events.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                      |
| {% endtab %}                                      |                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="Options" %}

| Name                             | Description                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| FailOnFileExists : `Boolean`     | <p>True: File already exists is treated as an error.</p><p>Whether an exception is thrown or Result with Success=false</p><p>is returned depends on ThrowErrorOnFailure option.</p><p>False: If file already exists, it will be skipped and added</p><p>to the Result dictionary instead of stopping the Task.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| ThrowErrorOnFailure : `Boolean`  | <p>True: Throw an exception on failure.</p><p>False: Return Result with Success=false and Error with description of exception.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                 |
| ErrorMessageOnFailure : `String` | <p>Custom error message to use when ThrowErrorOnFailure is true or when returning an error result.</p><p>If empty, the original exception message is used.</p><p><br>Default: <code>-</code><br>Example: <code>Custom error message</code></p>                                                                                                                                        |
| {% endtab %}                     |                                                                                                                                                                                                                                                                                                                                                                                       |
| {% endtabs %}                    |                                                                                                                                                                                                                                                                                                                                                                                       |

## Task Result

| Name                                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`                 | <p>Operation complete. Returns false if ThrowErrorOnFailure is disabled and error occurred. Returns true otherwise.<br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                          |
| Data : `Dictionary<String, String>` | <p>This object contains the list of local source file paths and their respective URLs in Azure Data Lake. If an ignorable error occurs, such as when a file already exists and Options.ThrowErrorOnFailure is set to false, the URL will be replaced with the corresponding error message.age.<br>Example: <code>{ { c:\temp\examplefile.txt, <https://storage.dfs.core.windows.net/container/examplefile.txt> }, { c:\temp\examplefile2.txt, File examplefile2 already exists. } }</code></p> |
| Error : `Error`                     | <p>Error information when Success is false and ThrowErrorOnFailure is false.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p>                                                                                                                                                                                                                                                                                                                                  |
| Error.Message : `String`            | <p>Error message.<br>Example: <code>Upload failed.</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Error.AdditionalInfo : `Exception`  | <p>The exception that caused the failure.<br>Example: <code>object { Exception AdditionalInfo }</code></p>                                                                                                                                                                                                                                                                                                                                                                                     |
| ErrorMessage : `String`             | <p>This object contains the error message if task fail.<br>Example: <code>Container ex does not exist</code></p>                                                                                                                                                                                                                                                                                                                                                                               |

## Task Changelog

Changelog for Task Frends.AzureDataLake.UploadFiles.

### \[2.0.0] - 2026-08-13

#### Changed

* \[Breaking Change] Options is now a separate task parameter (previously it was nested inside Input). You will need to provide it as a distinct input when configuring the task.
* \[Breaking Change] When the task fails and `ThrowErrorOnFailure` is disabled, the result now includes an `Error` object with detailed error information in addition to the existing `ErrorMessage` string.
* \[Breaking Change] Replaced `ThrowErrorOnFailure` behavior for file conflicts: the option previously controlled whether a file-already-exists situation threw an exception or was silently skipped. This is now a separate `FailOnFileExists` option. `ThrowErrorOnFailure` now solely controls whether task failures throw an exception or return a Result with `Success=false`.
* Added `ErrorMessageOnFailure` option: you can now specify a custom error message that will be used when the task fails.
* Upgraded target framework to .NET 8.

### \[1.4.0] - 2026-01-15

#### Changed

* Updated Azure packages to latest versions:
* Azure.Storage.Files.DataLake 12.25.0
* Azure.Identity 1.17.1

### \[1.3.0] - 2025-05-07

#### Added

* Added new Close parameter to control whether the uploaded file is finalized after upload.
* Use the default parameter value ('true') if you want the upload operation to work as before (automatically closing the stream).
* Set to 'false' if you need to manage the stream lifecycle manually after upload.

### \[1.2.0] - 2024-08-23

#### Changed

* Updated the Azure.Identity package to version 1.12.0.

### \[1.1.0] - 2024-05-20

#### Added

* Added FrendsTaskMetadata.json

### \[1.0.0] - 2024-05-14

#### Added

* Initial implementation of Frends.AzureDataLake.UploadFiles.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/azure-data-lake/uploadfiles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
