Soenneker.Blob.Upload
11.0.3380
Prefix Reserved
dotnet add package Soenneker.Blob.Upload --version 11.0.3380
NuGet\Install-Package Soenneker.Blob.Upload -Version 11.0.3380
<PackageReference Include="Soenneker.Blob.Upload" Version="11.0.3380" />
<PackageVersion Include="Soenneker.Blob.Upload" Version="11.0.3380" />
<PackageReference Include="Soenneker.Blob.Upload" />
paket add Soenneker.Blob.Upload --version 11.0.3380
#r "nuget: Soenneker.Blob.Upload, 11.0.3380"
#:package Soenneker.Blob.Upload@11.0.3380
#addin nuget:?package=Soenneker.Blob.Upload&version=11.0.3380
#tool nuget:?package=Soenneker.Blob.Upload&version=11.0.3380
Soenneker.Blob.Upload
Uploads files, streams, bytes, and text to Azure block blobs.
Installation
dotnet add package Soenneker.Blob.Upload
Configuration
{
"Environment": "Production",
"Azure": {
"Storage": {
"Blob": {
"ConnectionString": "<connection string>",
"AccountName": "<storage account name>",
"AccountKey": "<storage account key>"
}
}
}
}
The connection string is used for uploads. The account name, account key, and environment are required by the registered SAS utility and by UploadAndGetSasUri.
Registration
using Microsoft.Extensions.DependencyInjection;
using Soenneker.Blob.Upload.Registrars;
services.AddBlobUploadUtilAsSingleton();
AddBlobUploadUtilAsScoped() is also available.
Upload text or bytes
using Soenneker.Blob.Upload.Abstract;
public sealed class ManifestStore
{
private readonly IBlobUploadUtil _uploads;
public ManifestStore(IBlobUploadUtil uploads)
{
_uploads = uploads;
}
public async ValueTask Save(
string json,
CancellationToken cancellationToken)
{
_ = await _uploads.Upload(
"assets",
"manifests/latest.json",
json,
contentType: "application/json",
cancellationToken: cancellationToken);
}
}
Upload a file or stream
Use the file and stream overloads to avoid first copying large content into a byte array:
_ = await uploads.UploadFromFile(
"exports",
"daily/archive.zip",
absolutePath,
contentType: "application/zip",
cancellationToken: cancellationToken);
await using FileStream input = File.OpenRead(absolutePath);
_ = await uploads.Upload(
"exports",
"daily/archive.zip",
input,
contentType: "application/zip",
cancellationToken: cancellationToken);
The stream overload begins at the stream's current position and does not dispose or rewind it.
Upload and create a read URL
string sasUri = await uploads.UploadAndGetSasUri(
"private-assets",
"previews/report.pdf",
pdfBytes,
contentType: "application/pdf",
cancellationToken: cancellationToken);
The returned URL is read-only and expires after one month. Treat it as a credential: do not log it or expose it to callers that should not read the blob.
Behavior
- Every upload overwrites an existing block blob at the same container and path. This API does not expose conditional create or ETag protection.
- Supplying
contentTypestores it in the blob's HTTP headers. The library does not infer a MIME type from a filename. - Byte-array and string overloads buffer content in a temporary memory stream. Prefer file or stream uploads for large or untrusted payloads.
- The caller owns streams passed to
Upload; the library-owned streams used by byte and string overloads are disposed automatically. - The underlying client utility creates a missing container.
publicAccessTypeapplies only during that creation and does not change an existing container's access level. - Azure service failures are thrown as
RequestFailedException; cancellation is passed through to client creation and upload.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Blob.Sas (>= 11.0.3170)
- Soenneker.Utils.MemoryStream (>= 11.0.1636)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blob.Upload:
| 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.3380 | 0 | 12/1/2026 |
| 11.0.3379 | 0 | 12/1/2026 |
| 11.0.3378 | 0 | 12/1/2026 |
| 11.0.3377 | 6 | 12/1/2026 |
| 11.0.3376 | 37 | 12/1/2026 |
| 11.0.3375 | 36 | 12/1/2026 |
| 11.0.3374 | 42 | 12/1/2026 |
| 11.0.3373 | 58 | 12/1/2026 |
| 11.0.3372 | 42 | 12/1/2026 |
| 11.0.3371 | 55 | 12/1/2026 |
| 11.0.3370 | 57 | 11/30/2026 |
| 11.0.3369 | 81 | 11/30/2026 |
| 11.0.3368 | 75 | 11/30/2026 |
| 11.0.3367 | 71 | 11/29/2026 |
| 11.0.3366 | 62 | 11/29/2026 |
| 11.0.3365 | 60 | 11/29/2026 |
| 11.0.3364 | 142 | 11/21/2026 |
| 11.0.3363 | 154 | 11/19/2026 |
| 11.0.3362 | 140 | 11/19/2026 |
Updated Multiple NuGet packages