UA.Azure.Storage 10.1.4

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

UA.Azure.Storage

NuGet Downloads Tests Coverage Branch coverage Docs License: MIT

UA.Azure.Storage is the Azure Storage package in the UA Devs stack. It uses a lightweight, REST-first programming model built on UA.Tenet agents: you send request models to Blob, Queue, and Table agents, and you get back StorageResponse so you can inspect headers, payloads, and status codes directly.

Why this package exists

Use UA.Azure.Storage when you want:

  • one lightweight package for Blob, Queue, and Table storage operations
  • direct control over Azure Storage REST behavior without the full Azure SDK surface
  • stream-first blob upload and download flows
  • explicit metadata, request ID, lease, tag, and OData query control
  • an API style that fits naturally into Tenet services and agents

Package characteristics

  • Targets .NET 10.
  • Depends on UA.Tenet and signs Azure Storage requests from a connection string.
  • Uses request models such as BlobRequest, ContainerRequest, QueueRequest, MessageRequest, TableRequest, and EntityRequest.
  • Returns StorageResponse, which exposes status code, headers, request metadata, and typed helpers such as ReadStream(), ReadString(), ReadJson<T>(), and ReadXml<T>().

Programming model

UA.Azure.Storage does not try to hide the transport. Each agent issues Azure Storage REST calls and returns a StorageResponse that you can inspect or deserialize as needed.

using UA.Azure.Storage.Blob;
using UA.Azure.Storage.Internals.Models;

BlobAgent blobs = new(connectionString, autoAssignRequestId: true);

using StorageResponse response = await blobs.GetBlob(("documents", "invoice.pdf"));

if (!response.IsSuccessStatusCode)
    throw new InvalidOperationException(await response.ReadString());

await using Stream payload = await response.ReadStream();

Useful shorthand conversions are built into the current request model set:

  • ContainerRequest, QueueRequest, and TableRequest can be created from strings
  • BlobRequest can be created from (containerName, blobName) tuples
  • MessageItem.DecodedText exposes queue message text after Base64 decoding

Current agent surface

Agent Best current operations Notes
BlobAgent Service properties and stats, preflight, container create, delete, existence, properties, lease, ACL and metadata, container listing, blob put (block, empty page and empty append blobs), get, delete, existence, properties, metadata, tags, tier, expiry, snapshot, undelete, lease, copy, abort copy, block and page uploads, query contents, and find by tags Blob names are passed unencoded and URL-encoded per path segment. Some operations read options from BlobRequest.Metadata (for example lease-action, latest, blockid or encryption-scope); those option keys are never sent as x-ms-meta-* metadata. GetBlob streams its content, so dispose the response after reading it
QueueAgent Queue create or delete or list, ACL and metadata reads and writes, message create or delete or list or update, and account-level service calls Message bodies are Base64-encoded (UTF-8) on create and update without modifying the MessageItem. Deserialize MessageList and read MessageItem.DecodedText on the way back. Getting messages without a positive visibility timeout uses the 30 seconds service default
TableAgent Table create or delete or query, ACL reads and writes, service properties, entity create or update or delete or merge or upsert or query, and batch execution Batch() emits IAsyncEnumerable<StorageResponse> with one entity group transaction of at most 100 operations per table. Update, merge and delete (single or batched) require an existing entity (If-Match: *); use the upsert operations to insert. Entity keys are escaped in the URI, long values are sent as Edm.Int64 and floating-point values as Edm.Double, and object and array values are serialized as JSON text. Use ODataQuery.Page(...) and ODataQuery.PageTables(...) with the x-ms-continuation-* response headers to read the next page

Installation

dotnet add package UA.Azure.Storage

Quick start

Blob upload and download

using UA.Azure.Storage.Blob;
using UA.Azure.Storage.Blob.Models;
using UA.Azure.Storage.Internals.Models;

BlobAgent blobs = new(connectionString, autoAssignRequestId: true);

await blobs.CreateContainer("documents");

await using FileStream file = File.OpenRead("invoice.pdf");

using StorageResponse upload = await blobs.PutBlob(new BlobRequest
{
    Container = "documents",
    Name = "invoice.pdf",
    Content = file,
    MimeType = "application/pdf"
});

using StorageResponse download = await blobs.GetBlob(("documents", "invoice.pdf"));
await using Stream payload = await download.ReadStream();

Queue create, send, and peek

using UA.Azure.Storage.Internals.Models;
using UA.Azure.Storage.Queue;
using UA.Azure.Storage.Queue.Models;

QueueAgent queues = new(connectionString, autoAssignRequestId: true);

await queues.Create("processing-queue");

using StorageResponse send = await queues.Create(
    new MessageRequest("processing-queue"),
    new MessageItem { RawText = "Process order #12345" });

using StorageResponse peek = await queues.List(
    new MessageRequest("processing-queue"),
    maxResults: 5,
    isPeekOnly: true);

MessageList? messages = await peek.ReadXml<MessageList>();

foreach (MessageItem message in messages?.Items ?? [])
{
    Console.WriteLine(message.DecodedText);
}

Table upsert and query

using UA.Azure.Storage.Internals.Models;
using UA.Azure.Storage.Table;
using UA.Azure.Storage.Table.Models;
using UA.Tenet.Collections;

TableAgent tables = new(connectionString, autoAssignRequestId: true);

await tables.Create("Customers");

Any<object> customer = new()
{
    [TableAgent.PartitionKey] = "ES",
    [TableAgent.RowKey] = "customer-001",
    ["Name"] = "John Doe",
    ["Email"] = "john@example.com"
};

await tables.ReplaceUpsert(new EntityRequest("Customers", "ES", "customer-001"), customer);

ODataQuery query = new()
    .Select(["Name", "Email"])
    .And(TableAgent.PartitionKey, ODataOperator.Equal, "ES")
    .Top(100);

using StorageResponse response = await tables.Query(
    new EntityRequest("Customers"),
    query,
    includeMetadata: true);

string json = await response.ReadString();

Configuration and dependency injection

Using a connection string

string connectionString = configuration.GetConnectionString("AzureStorage")
    ?? throw new InvalidOperationException("Missing AzureStorage connection string.");

BlobAgent blobs = new(connectionString, autoAssignRequestId: true);

Registering agents in DI

builder.Services.AddSingleton(sp =>
    new BlobAgent(configuration.GetConnectionString("AzureStorage")!, autoAssignRequestId: true));

builder.Services.AddSingleton(sp =>
    new QueueAgent(configuration.GetConnectionString("AzureStorage")!, autoAssignRequestId: true));

builder.Services.AddSingleton(sp =>
    new TableAgent(configuration.GetConnectionString("AzureStorage")!, autoAssignRequestId: true));

Important notes

  • Agents derive their base URLs and request signing from the connection string, so AccountName and AccountKey must be present. BlobEndpoint, QueueEndpoint and TableEndpoint override the host-style endpoint, which enables path-style endpoints such as Azurite.
  • Blob and Queue requests are signed with Shared Key and Table requests with Shared Key Lite.
  • GetServiceStats() targets the read-access secondary endpoint (SecondaryBaseUrl), taken from {Service}SecondaryEndpoint or derived from the primary endpoint ({account}-secondary).
  • PreflightRequest(origin, method, requestHeaders, resourcePath) sends an anonymous CORS preflight with the required Origin and Access-Control-Request-* headers.
  • SetAcl(...)/SetContainerAcl(...) accept up to five SignedIdentifier stored access policies (an empty list clears them); read Get ACL responses with ReadXml<SignedIdentifierList>().
  • Read* methods return empty values for unsuccessful responses; use StorageResponse.ErrorCode (x-ms-error-code) and ReadError() (code, message and raw XML/JSON body) instead.
  • Set RetryOptions on an agent to opt in to retries of transient failures (network errors and 408, 429, 500, 502, 503, 504) with exponential backoff. Streamed blob uploads are sent once.
  • Queue message time-to-live accepts any positive number of seconds or -1 (never expires).
  • StorageResponse is IDisposable. Dispose it after consuming the content stream or body.
  • Queue messages are Base64-encoded on send. Use MessageItem.DecodedText after deserializing the response payload.
  • TableAgent.Batch() sends one entity group transaction per table and group of 100 operations, and yields one StorageResponse per submitted batch.
  • Table entity request payloads normalize object and array values to JSON text and add @odata.type annotations for Edm.Int64 and Edm.Double values so the REST payload uses Azure Table-compatible value shapes.
  • ODataQuery quotes string literals (doubling '), keeps numeric and boolean literals unquoted, rejects property names that are not identifiers, and throws when a filter exceeds the service limit of 15 comparisons. Conditions the Table service cannot express (Exists, Length, non-prefix Like) are widened so no matching entity is missed; re-check them on the client when exact results are required.
  • This package is a lightweight REST wrapper, not a full replacement for the Azure SDK.

Documentation

For broader documentation and Azure protocol details, see:

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
11.0.0 109 11/16/2026
10.1.5 140 10/23/2026
10.1.4 125 10/17/2026
10.1.3 124 10/1/2026
10.1.2 111 9/26/2026
10.1.1 110 9/24/2026
10.1.0 123 9/16/2026
10.0.3 174 4/1/2026
10.0.2 161 4/1/2026
10.0.1 138 3/31/2026
10.0.0 140 3/26/2026
4.11.3 149 3/25/2026
Loading failed

See https://docs.uadevs.org/azure-storage/release-notes for release notes and documentation.