Soenneker.Blob.Container 4.0.3010

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

Creates missing Azure Blob containers and caches their BlobContainerClient instances for reuse.

Install

dotnet add package Soenneker.Blob.Container

Configure the required connection string:

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

Supply the real value through an environment-specific secret provider.

Register the singleton utility in Program.cs:

using Soenneker.Blob.Container.Registrars;

builder.Services.AddBlobContainerUtilAsSingleton();

Singleton is the normal lifetime because the utility owns the container-client and HTTP-client caches. Scoped registration is available for specialized hosts, while its HTTP-client cache remains singleton.

Resolve a container

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

BlobContainerClient invoices = await blobContainers.Get(
    "Invoices",
    cancellationToken: cancellationToken);

The name is normalized to lowercase, so this example targets invoices. The first lookup atomically creates the container if it is missing; concurrent creators do not require a separate existence check.

The returned Azure SDK client can be used directly:

await foreach (BlobItem blob in invoices.GetBlobsAsync(
                   cancellationToken: cancellationToken))
{
    Console.WriteLine(blob.Name);
}

Public access

Containers are private by default:

BlobContainerClient assets = await blobContainers.Get(
    "public-assets",
    PublicAccessType.Blob,
    cancellationToken);

publicAccessType applies only when the container is created. It does not read, verify, or change the access policy of an existing container. Clients are cached by normalized container name, so every caller must use one consistent creation policy for that container.

Public access can expose stored data without authentication. Prefer PublicAccessType.None and issue narrowly scoped SAS URLs when external access is required.

Operational behavior

  • Cancellation stops pending work; it does not undo work that has already completed.
  • Container creation requires credentials with the appropriate storage-account permission.
  • A successful lookup is cached for the utility lifetime. External container deletion is not detected by the cache; later SDK operations will report that the container is missing.
  • Dependency injection disposes the utility and its shared transport. Manually created instances must be disposed.
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 (2)

Showing the top 2 NuGet packages that depend on Soenneker.Blob.Container:

Package Downloads
Soenneker.Blob.Client

A utility library for Azure Blob client accessibility

Soenneker.Blob.Fetch

A utility library for Azure Blob fetch (metadata) operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.3054 0 10/27/2026
11.0.3053 77 10/26/2026
11.0.3051 85 10/26/2026
11.0.3048 98 10/26/2026
11.0.3047 81 10/26/2026
11.0.3046 83 10/26/2026
11.0.3045 80 10/26/2026
4.0.3044 83 10/26/2026
4.0.3043 2,232 10/15/2026
4.0.3042 225 10/14/2026
4.0.3040 230 10/14/2026
4.0.3039 246 10/14/2026
4.0.3037 93 10/14/2026
4.0.3036 171 10/14/2026
4.0.3035 90 10/14/2026
4.0.3029 270 10/13/2026
4.0.3027 168 10/12/2026
4.0.3024 262 10/12/2026
4.0.3023 436 10/12/2026
4.0.3010 266 9/29/2026
Loading failed

Updated Soenneker.Utils.HttpClientCache to 4.0.2097