Soenneker.Blob.Client 4.0.2175

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Blob.Client --version 4.0.2175
                    
NuGet\Install-Package Soenneker.Blob.Client -Version 4.0.2175
                    
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="Soenneker.Blob.Client" Version="4.0.2175" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blob.Client" Version="4.0.2175" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blob.Client" />
                    
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 Soenneker.Blob.Client --version 4.0.2175
                    
#r "nuget: Soenneker.Blob.Client, 4.0.2175"
                    
#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 Soenneker.Blob.Client@4.0.2175
                    
#: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=Soenneker.Blob.Client&version=4.0.2175
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blob.Client&version=4.0.2175
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blob.Client

Resolves Azure BlobClient instances through a cached container client and creates a missing container before returning the blob client.

Install

dotnet add package Soenneker.Blob.Client

Configure the Azure Storage connection string:

{
  "Azure": {
    "Storage": {
      "Blob": {
        "ConnectionString": "<connection string>"
      }
    }
  }
}

Keep the real value in an environment-specific secret provider rather than committing it to configuration files.

Register the utility in Program.cs:

using Soenneker.Blob.Client.Registrars;

builder.Services.AddBlobClientUtilAsSingleton();

The singleton registration is the usual choice. A scoped registration is available, but it still uses the singleton container cache.

Resolve a blob client

using Azure.Storage.Blobs;
using Soenneker.Blob.Client.Abstract;

public sealed class InvoiceStore(IBlobClientUtil blobClients)
{
    public async ValueTask<BlobClient> GetInvoice(
        Guid invoiceId,
        CancellationToken cancellationToken)
    {
        return await blobClients.Get(
            "invoices",
            $"2026/{invoiceId:N}.pdf",
            cancellationToken: cancellationToken);
    }
}

relativeUrl is an Azure blob name, not a URL. Slashes create a virtual hierarchy in tools and listings, but the name remains one blob key.

The returned BlobClient can be used with the Azure SDK directly:

BlobClient blob = await blobClients.Get(
    "invoices",
    "2026/summary.pdf",
    cancellationToken: cancellationToken);

await blob.UploadAsync(stream, overwrite: true, cancellationToken);

Container behavior

  • Container names are converted to lowercase before lookup.
  • The first lookup for a container checks Azure and creates it if missing.
  • PublicAccessType.None is the default and keeps a newly created container private.
  • publicAccessType is used only when creating a missing container. It does not inspect or change the access policy of an existing container.
  • Container clients are cached by normalized container name. Use one consistent public-access choice for each container.

Operational notes

  • Cancellation stops pending work; it does not undo work that has already completed.
  • Resolving a blob client can perform a container existence check or creation, so it is not a purely local factory call.
  • This utility does not upload, download, overwrite, delete, or authorize individual blobs; those behaviors come from the returned Azure SDK client and its credentials.
  • Treat public container access as an explicit data-exposure decision. Prefer private containers and SAS URLs for limited external access.
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 (3)

Showing the top 3 NuGet packages that depend on Soenneker.Blob.Client:

Package Downloads
Soenneker.Blob.Download

A utility library for Azure Blob download operations

Soenneker.Blob.Delete

A utility library for Azure Blob storage delete operations

Soenneker.Blob.Sas

A utility library for Azure Blob SAS operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.2176 0 8/30/2026
4.0.2175 0 8/30/2026
4.0.2174 23 8/30/2026
4.0.2173 147 8/30/2026
4.0.2172 57 8/30/2026
4.0.2171 28 8/30/2026
4.0.2170 59 8/29/2026
4.0.2169 37 8/29/2026
4.0.2168 34 8/29/2026
4.0.2167 274 8/26/2026
4.0.2166 129 8/26/2026
4.0.2165 99 8/26/2026
4.0.2164 144 8/25/2026
4.0.2163 260 8/22/2026
4.0.2162 215 8/22/2026
4.0.2161 347 8/21/2026
4.0.2160 893 8/19/2026
4.0.2159 466 8/13/2026
4.0.2158 166 8/13/2026
4.0.2157 285 8/12/2026
Loading failed

Update dependency Soenneker.Blob.Container to 4.0.2954 (#2859)