Soenneker.Blob.Download
11.0.3724
Prefix Reserved
dotnet add package Soenneker.Blob.Download --version 11.0.3724
NuGet\Install-Package Soenneker.Blob.Download -Version 11.0.3724
<PackageReference Include="Soenneker.Blob.Download" Version="11.0.3724" />
<PackageVersion Include="Soenneker.Blob.Download" Version="11.0.3724" />
<PackageReference Include="Soenneker.Blob.Download" />
paket add Soenneker.Blob.Download --version 11.0.3724
#r "nuget: Soenneker.Blob.Download, 11.0.3724"
#:package Soenneker.Blob.Download@11.0.3724
#addin nuget:?package=Soenneker.Blob.Download&version=11.0.3724
#tool nuget:?package=Soenneker.Blob.Download&version=11.0.3724
Soenneker.Blob.Download
Downloads Azure blobs to temporary files, memory streams, or strings.
Installation
dotnet add package Soenneker.Blob.Download
Configuration
Provide the Azure Storage connection string through configuration:
{
"Azure": {
"Storage": {
"Blob": {
"ConnectionString": "<connection string>"
}
}
}
}
Registration
using Microsoft.Extensions.DependencyInjection;
using Soenneker.Blob.Download.Registrars;
services.AddBlobDownloadUtilAsScoped();
AddBlobDownloadUtilAsSingleton() is also available when a singleton lifetime fits the application.
Usage
using Soenneker.Blob.Download.Abstract;
public sealed class DocumentStore
{
private readonly IBlobDownloadUtil _downloads;
public DocumentStore(IBlobDownloadUtil downloads)
{
_downloads = downloads;
}
public async ValueTask<string> ReadManifest(CancellationToken cancellationToken)
{
return await _downloads.DownloadToString(
"documents",
"manifests/latest.json",
cancellationToken: cancellationToken);
}
}
Download to a temporary file when the content should not be buffered in memory:
FileInfo file = await downloads.Download(
"documents",
"exports/archive.zip",
cancellationToken: cancellationToken);
try
{
// Consume file here.
}
finally
{
file.Delete();
}
For in-memory processing, dispose the returned stream:
await using MemoryStream stream = await downloads.DownloadToMemory(
"documents",
"images/logo.png",
cancellationToken: cancellationToken);
Choosing a download method
| Method | Use it when | Ownership |
|---|---|---|
Download |
The blob may be large or a file-based API needs the result | Delete the returned temporary file |
DownloadToMemory |
A stream-based API needs reasonably sized content | Dispose the returned stream |
DownloadToString |
The blob is reasonably sized text | Returns an owned string |
Behavior
DownloadToMemoryandDownloadToStringbuffer the entire blob. PreferDownloadfor large or untrusted content.- The stream returned by
DownloadToMemoryis positioned at0. - Failed file downloads remove the incomplete temporary file when possible. Failed memory downloads dispose their stream.
- A missing blob is reported through Azure's
RequestFailedException, including a404status when returned by the service. publicAccessTypeis used only if the underlying client utility creates a missing container; it does not update an existing container's access level.- Cancellation is passed to Azure Storage and temporary resource creation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Blob.Client (>= 11.0.2276)
- Soenneker.Utils.File (>= 11.0.2342)
- Soenneker.Utils.Path (>= 11.0.1275)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blob.Download:
| Package | Downloads |
|---|---|
|
Soenneker.Blob.Suite
A concoction of Azure Blob Storage utilities and libraries |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.3724 | 98 | 11/11/2026 |
| 11.0.3722 | 97 | 11/11/2026 |
| 11.0.3721 | 79 | 11/11/2026 |
| 11.0.3719 | 96 | 11/11/2026 |
| 11.0.3718 | 82 | 11/11/2026 |
| 11.0.3717 | 76 | 11/11/2026 |
| 11.0.3715 | 79 | 11/11/2026 |
| 11.0.3714 | 100 | 11/11/2026 |
| 11.0.3713 | 139 | 11/3/2026 |
| 11.0.3712 | 115 | 11/3/2026 |
| 11.0.3711 | 104 | 11/3/2026 |
| 11.0.3710 | 91 | 11/3/2026 |
| 11.0.3709 | 101 | 11/3/2026 |
| 11.0.3708 | 115 | 11/3/2026 |
| 11.0.3706 | 125 | 11/3/2026 |
| 11.0.3705 | 105 | 11/2/2026 |
| 11.0.3704 | 103 | 11/2/2026 |
| 11.0.3703 | 141 | 10/29/2026 |
| 11.0.3702 | 105 | 10/28/2026 |
| 11.0.3701 | 137 | 10/27/2026 |
Updated Soenneker.Blob.Client to 11.0.2276