# DownloadBlob

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.AzureBlobStorage/tree/main/Frends.AzureBlobStorage.DownloadBlob>

{% tabs %}
{% tab title="Parameter: Source" %}

| Name                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ContainerName : `String`      | <p>Name of the Azure Blob Storage container where the file is downloaded from.</p><p><br>Default: <code>-</code><br>Example: <code>ExampleContainer</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| BlobName : `String`           | <p>Name of the blob to download.</p><p><br>Default: <code>-</code><br>Example: <code>sample.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Encoding : `FileEncoding`     | <p>Set desired content-encoding.</p><p>Defaults to UTF8 BOM.</p><p>Possible values:</p><ul><li><code>UTF8</code>:</li></ul><p>Set desired content-encoding.</p><p>Defaults to UTF8 BOM.</p><ul><li><code>Default</code>:</li></ul><p>Set desired content-encoding.</p><p>Defaults to UTF8 BOM.</p><ul><li><code>ASCII</code>:</li></ul><p>Set desired content-encoding.</p><p>Defaults to UTF8 BOM.</p><ul><li><code>WINDOWS1252</code>:</li></ul><p>Set desired content-encoding.</p><p>Defaults to UTF8 BOM.</p><ul><li><code>Other</code>:</li></ul><p>Set desired content-encoding.</p><p>Defaults to UTF8 BOM.</p><p><br>Default: <code>0</code><br>Example: <code>utf8</code></p> |
| EnableBOM : `Boolean`         | <p>Enables BOM for UTF-8.</p><p><br>Default: <code>True</code><br>Example: <code>-</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| FileEncodingString : `String` | <p>Content encoding as string. A partial list of possible encodings: <https://en.wikipedia.org/wiki/Windows_code_page#List>.</p><p><br>Default: <code>-</code><br>Example: <code>windows-1252</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| {% endtab %}                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

{% tab title="Parameter: Destination" %}

| Name                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Directory : `String`                     | <p>Destination directory.</p><p><br>Default: <code>-</code><br>Example: <code>c:\temp</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| FileExistsOperation : `FileExistsAction` | <p>Error: Throws exception if destination file exists.</p><p>Rename: Adds '(1)' at the end of file name. Incerements the number if (1) already exists.</p><p>Overwrite: Overwrites existing file.</p><p>Possible values:</p><ul><li><code>Error</code>:</li></ul><p>Error: Throws exception if destination file exists.</p><p>Rename: Adds '(1)' at the end of file name. Incerements the number if (1) already exists.</p><p>Overwrite: Overwrites existing file.</p><ul><li><code>Rename</code>:</li></ul><p>Error: Throws exception if destination file exists.</p><p>Rename: Adds '(1)' at the end of file name. Incerements the number if (1) already exists.</p><p>Overwrite: Overwrites existing file.</p><ul><li><code>Overwrite</code>:</li></ul><p>Error: Throws exception if destination file exists.</p><p>Rename: Adds '(1)' at the end of file name. Incerements the number if (1) already exists.</p><p>Overwrite: Overwrites existing file.</p><p><br>Default: <code>0</code><br>Example: <code>Error</code></p> |
| TargetFileName : `String`                | <p>Optional custom filename for the downloaded blob. If not specified, the original blob name will be used.</p><p><br>Default: <code>-</code><br>Example: <code>customname.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| {% endtab %}                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

{% tab title="Parameter: Connection" %}

| Name                                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AuthenticationMethod : `ConnectionMethod` | <p>Defines which connection method should be used for connecting to Azure Blob Storage.</p><p>Possible values:</p><ul><li><code>ConnectionString</code>:</li></ul><p>Defines which connection method should be used for connecting to Azure Blob Storage.</p><ul><li><code>OAuth2</code>:</li></ul><p>Defines which connection method should be used for connecting to Azure Blob Storage.</p><ul><li><code>SasToken</code>:</li></ul><p>Defines which connection method should be used for connecting to Azure Blob Storage.</p><ul><li><code>ArcManagedIdentity</code>:</li></ul><p>Defines which connection method should be used for connecting to Azure Blob Storage.</p><ul><li><code>ArcManagedIdentityCrossTenant</code>:</li></ul><p>Defines which connection method should be used for connecting to Azure Blob Storage.</p><p><br>Default: <code>1</code><br>Example: <code>ConnectionMethod.ConnectionString</code></p> |
| 🗝ConnectionString : `String`             | <p>Connection string to Azure storage.</p><p><br>Default: <code>-</code><br>Example: <code>DefaultEndpointsProtocol=https;AccountName=account-name;AccountKey=abc==;EndpointSuffix=core.windows.net</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ApplicationId : `String`                  | <p>Application (Client) ID of Azure AD Application.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-abc33h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| TenantId : `String`                       | <p>Tenant ID of Azure Tenant.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-abc33h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 🗝ClientSecret : `String`                 | <p>Client Secret of Azure AD Application.</p><p><br>Default: <code>-</code><br>Example: <code>Password!</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 🗝SasToken : `String`                     | <p>A shared access signature to use when connecting to an Azure storage container.</p><p>Grants restricted access rights to Azure Storage resources when combined with URI.</p><p><br>Default: <code>-</code><br>Example: <code>sv=2021-04-10\&se=2022-04-10T10%3A431Z\&sr=c\&sp=l\&sig=ZJg983RovE%23ZXI</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| StorageAccountName : `String`             | <p>Name of the Azure storage account.</p><p><br>Default: <code>-</code><br>Example: <code>TestStorage</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Scopes : `String[]`                       | <p>Scopes used when authenticating with Arc Managed Identity Cross Tenant.</p><p><br>Default: <code>-</code><br>Example: <code>\[api://AzureADTokenExchange/.default]</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| TargetTenantId : `String`                 | <p>Target Tenant ID of Azure Tenant.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-abc33h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| TargetClientId : `String`                 | <p>Target Client ID of Azure Tenant.</p><p><br>Default: <code>-</code><br>Example: <code>Y6b1hf2a-80e2-xyz2-abc33h-3a7c3a8as4b7f</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| {% endtab %}                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

{% tab title="Result: Result" %}

| Name                 | Description                                                                          |
| -------------------- | ------------------------------------------------------------------------------------ |
| FileName : `String`  | <p>Name of the downloaded file.<br>Example: <code>sample.txt</code></p>              |
| Directory : `String` | <p>Directory where the file was downloaded.<br>Example: <code>c:\temp</code></p>     |
| FullPath : `String`  | <p>Full path to the downloaded file.<br>Example: <code>c:\temp\sample.txt</code></p> |
| {% endtab %}         |                                                                                      |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-04-26

#### Changed

* Standardized parameter names and validation across all Azure Blob Storage tasks for consistency.

### \[1.7.0] - 2026-01-28

#### Added

* Add options to support Arc Managed Identity authentication.

### \[1.6.0] - 2026-01-27

#### Added

* Added TargetFileName property to Destination for custom file naming when downloading blobs.

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

#### Changed

* Updated Azure packages to the latest versions:
* Azure.Storage.Blobs 12.27.0
* Azure.Identity 1.17.1

### \[1.4.0] - 2025-02-17

#### Added

* Added SAS Token authentication method.

### \[1.3.0] - 2024-08-21

#### Changed

* Updated Azure.Identity to version 1.12.0.
* Removed dependencies Azure.Core and Azure.Storage.Common.

### \[1.2.0] - 2024-01-31

#### Updated

* Azure.Identity to version 1.10.4
* Azure.Storage.Blobs to version 12.19.1
* Azure.Storage.Common to version 12.18.1
* Azure.Core to version 1.36.0
* MimeMapping to version 1.0.1.50

#### Fixed

* \[Breaking] Fixed Source parameters to be similar to the UploadFiles Task.

### \[1.1.1] - 2023-02-08

#### Fixed

* Fixed issue with empty encoding parameter.
* Memory leak fix by unloading assembly context after Task execution.

### \[1.1.0] - 2022-12-01

#### Added

* OAuth autentication method

#### Changed

* Security updated for dependency:
  * Azure.Storage.Blobs 12.13.1 to 12.14.1
  * Azure.Storage.Common 12.12.0 to 12.13.0
  * Azure.Core 1.25.0 to 1.26.0

### \[1.0.2] - 2022-09-02

#### Changed

* Security updated for dependency:
  * Azure.Storage.Blobs 12.10.0 to 12.13.1
  * Also updated dependencies:
  * Azure.Storage.Common 12.9.0 to 12.12.0
  * Azure.Core 1.20.0 to 1.25.0
  * System.ComponentModel.Annotations 4.7.0 to 5.0.0

### \[1.0.1] - 2022-02-28

#### Changed

* Support for .NET Standard 2.0 removed.

### \[1.0.0] - 2022-02-09

#### Added

* Initial implementation of Frends.AzureBlobStorage.DownloadBlob.
  {% endtab %}
  {% endtabs %}
