DKNet.Svc.BlobStorage.AzureStorage 10.1.19

dotnet add package DKNet.Svc.BlobStorage.AzureStorage --version 10.1.19
                    
NuGet\Install-Package DKNet.Svc.BlobStorage.AzureStorage -Version 10.1.19
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DKNet.Svc.BlobStorage.AzureStorage" Version="10.1.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DKNet.Svc.BlobStorage.AzureStorage" Version="10.1.19" />
                    
Directory.Packages.props
<PackageReference Include="DKNet.Svc.BlobStorage.AzureStorage" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DKNet.Svc.BlobStorage.AzureStorage --version 10.1.19
                    
#r "nuget: DKNet.Svc.BlobStorage.AzureStorage, 10.1.19"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DKNet.Svc.BlobStorage.AzureStorage@10.1.19
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DKNet.Svc.BlobStorage.AzureStorage&version=10.1.19
                    
Install as a Cake Addin
#tool nuget:?package=DKNet.Svc.BlobStorage.AzureStorage&version=10.1.19
                    
Install as a Cake Tool

DKNet.Svc.BlobStorage.AzureStorage

NuGet NuGet Downloads .NET License

Azure Blob Storage implementation of IBlobService from DKNet.Svc.BlobStorage.Abstractions, backed by Azure.Storage.Blobs.

Features

  • AzureStorageBlobService — full IBlobService implementation
  • Connection-string or BlobServiceClientFactory client 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed