DKNet.Svc.BlobStorage.AzureStorage
10.1.17
See the version list below for details.
dotnet add package DKNet.Svc.BlobStorage.AzureStorage --version 10.1.17
NuGet\Install-Package DKNet.Svc.BlobStorage.AzureStorage -Version 10.1.17
<PackageReference Include="DKNet.Svc.BlobStorage.AzureStorage" Version="10.1.17" />
<PackageVersion Include="DKNet.Svc.BlobStorage.AzureStorage" Version="10.1.17" />
<PackageReference Include="DKNet.Svc.BlobStorage.AzureStorage" />
paket add DKNet.Svc.BlobStorage.AzureStorage --version 10.1.17
#r "nuget: DKNet.Svc.BlobStorage.AzureStorage, 10.1.17"
#:package DKNet.Svc.BlobStorage.AzureStorage@10.1.17
#addin nuget:?package=DKNet.Svc.BlobStorage.AzureStorage&version=10.1.17
#tool nuget:?package=DKNet.Svc.BlobStorage.AzureStorage&version=10.1.17
DKNet.Svc.BlobStorage.AzureStorage
Azure Blob Storage implementation of IBlobService from
DKNet.Svc.BlobStorage.Abstractions, backed
by Azure.Storage.Blobs.
Features
AzureStorageBlobService— fullIBlobServiceimplementation- Connection-string or
BlobServiceClientFactoryclient construction (the latter for managed-identity auth) - Creates the configured container on first use if it does not exist
- SAS read URLs (
GetPublicAccessUrl), default 1-day expiry
Installation
dotnet add package DKNet.Svc.BlobStorage.AzureStorage
Quick Start
// appsettings.json
{
"BlobService": {
"AzureStorage": {
"ConnectionString": "DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...",
"ContainerName": "documents"
}
}
}
using DKNet.Svc.BlobStorage.Abstractions;
builder.Services.AddAzureStorageAdapter(builder.Configuration); // binds "BlobService:AzureStorage"
public sealed class ReportStorage(IBlobService blobService)
{
public Task<string> SaveAsync(Stream pdf, CancellationToken ct) =>
blobService.SaveAsync(new BlobDetails.BlobData("reports/monthly.pdf", BinaryData.FromStream(pdf)), ct);
}
There are two registration overloads, both extension members on IServiceCollection:
| Overload | What it does |
|---|---|
AddAzureStorageAdapter(IConfiguration configuration) |
Binds AzureStorageOptions from AzureStorageOptions.Name and registers IBlobService → AzureStorageBlobService as Scoped. Use this one. |
AddAzureStorageAdapter(Action<AzureStorageOptions> config) |
Registers the populated instance as a singleton AzureStorageOptions and the same scoped service — but the service reads IOptions<AzureStorageOptions>, so the values never reach it. Add services.Configure<AzureStorageOptions>(...) instead for anything configuration cannot bind, such as BlobServiceClientFactory. |
Configuration — AzureStorageOptions
AzureStorageOptions extends BlobServiceOptions, so IncludedExtensions, MaxFileNameLength, and
MaxFileSizeInMb apply here unchanged (see the Abstractions package).
| Option | Type | Default | Effect |
|---|---|---|---|
ContainerName |
string |
(required) | Target container. Created on first use when missing. |
ConnectionString |
string? |
null |
Storage account connection string. Used only when BlobServiceClientFactory is unset. |
BlobServiceClientFactory |
Func<AzureStorageOptions, Task<BlobServiceClient>>? |
null |
Builds the client yourself — the hook for managed identity or any custom client. Takes precedence over ConnectionString, and cannot be set by configuration binding. |
AzureStorageOptions.Name (static) |
string |
"BlobService:AzureStorage" |
The configuration section the IConfiguration overload binds from. |
Leaving both ConnectionString and BlobServiceClientFactory unset throws ArgumentException on the first
operation. Per-call settings live on the request: BlobDetails.BlobData.Overwrite (default false) and
GetPublicAccessUrl(..., expiresFromNow) (default TimeSpan.FromDays(1)).
Documentation
Full feature reference, diagrams, and gotchas: https://github.com/baoduy/DKNet/blob/main/docs/Services/DKNet.Svc.BlobStorage.AzureStorage.md
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Storage.Blobs (>= 12.29.2)
- DKNet.Svc.BlobStorage.Abstractions (>= 10.1.17)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.11)
- Microsoft.Extensions.Options (>= 10.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.1.19 | 0 | 9/3/2026 |
| 10.1.18 | 0 | 9/3/2026 |
| 10.1.17 | 0 | 9/3/2026 |
| 10.1.16 | 0 | 9/3/2026 |
| 10.1.15 | 66 | 9/1/2026 |
| 10.1.14 | 61 | 9/1/2026 |
| 10.1.13 | 78 | 8/31/2026 |
| 10.1.12 | 80 | 8/25/2026 |
| 10.1.11 | 92 | 8/24/2026 |
| 10.1.10 | 90 | 8/22/2026 |
| 10.1.9 | 93 | 8/22/2026 |
| 10.1.8 | 84 | 8/21/2026 |
| 10.1.7 | 91 | 8/21/2026 |
| 10.1.6 | 90 | 8/21/2026 |
| 10.1.5 | 90 | 8/20/2026 |
| 10.1.4 | 87 | 8/20/2026 |
| 10.1.3 | 94 | 8/19/2026 |
| 10.1.2 | 92 | 8/19/2026 |
| 10.1.1 | 90 | 8/19/2026 |
| 10.0.36 | 91 | 8/18/2026 |