Orleans.Lattice.Caching.AzureBlob API reference
This page documents Orleans.Lattice.Caching.AzureBlob 9.9.0, in the documentation for Orleans.Lattice 9.9.0 (release line 9.9), built 2026-10-04. It is also published as markdown, with every table and list, at api.md, and llms.txt lists every page.The package's public surface is deliberately small: one options type and one registration extension. The cache implementation itself is internal and reached only through the IDistributedCache abstraction.
LatticeAzureBlobCacheOptions
A sealed class configuring the account, container, key layout, and client. Every property and the DefaultContainerName constant are covered in configuration.
LatticeAzureBlobCacheServiceCollectionExtensions
A static class with one extension method.
using Microsoft.Extensions.DependencyInjection;
using Orleans.Lattice.Caching.AzureBlob;
public static class AzureBlobCacheRegistration
{
public static IServiceCollection AddCache(IServiceCollection services)
{
services.AddAzureBlobDistributedCache(options =>
{
options.ConnectionString = "UseDevelopmentStorage=true";
});
return services;
}
}
Registers the Azure Blob-backed cache as the application's IDistributedCache.
- Throws
ArgumentNullExceptionwhenservicesorconfigureis null. - The cache is added as the last
IDistributedCacheregistration, so it wins over an earlierAddDistributedMemoryCache. Call it once. - A
TimeProvideris resolved from the container when one is registered (for deterministic tests) and otherwise defaults toTimeProvider.System. - The container client is built once, from the single populated authentication mode, when the cache is first resolved. Option validation therefore happens at first resolution, not at registration.
Because the registration targets the standard IDistributedCache seam, no consumer references this package at the call site: a Microsoft.Identity.Web distributed token cache, ASP.NET session state, or output caching all resolve the abstraction and get the blob backend.
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.DependencyInjection;
using Orleans.Lattice.Caching.AzureBlob;
public static class CacheResolution
{
public static IDistributedCache Resolve()
{
var services = new ServiceCollection();
services.AddAzureBlobDistributedCache(o => o.ConnectionString = "UseDevelopmentStorage=true");
using var provider = services.BuildServiceProvider();
return provider.GetRequiredService<IDistributedCache>();
}
}