Microsoft.Orleans.Journaling.AzureStorage
10.3.1-alpha.1
Prefix Reserved
dotnet add package Microsoft.Orleans.Journaling.AzureStorage --version 10.3.1-alpha.1
NuGet\Install-Package Microsoft.Orleans.Journaling.AzureStorage -Version 10.3.1-alpha.1
<PackageReference Include="Microsoft.Orleans.Journaling.AzureStorage" Version="10.3.1-alpha.1" />
<PackageVersion Include="Microsoft.Orleans.Journaling.AzureStorage" Version="10.3.1-alpha.1" />
<PackageReference Include="Microsoft.Orleans.Journaling.AzureStorage" />
paket add Microsoft.Orleans.Journaling.AzureStorage --version 10.3.1-alpha.1
#r "nuget: Microsoft.Orleans.Journaling.AzureStorage, 10.3.1-alpha.1"
#:package Microsoft.Orleans.Journaling.AzureStorage@10.3.1-alpha.1
#addin nuget:?package=Microsoft.Orleans.Journaling.AzureStorage&version=10.3.1-alpha.1&prerelease
#tool nuget:?package=Microsoft.Orleans.Journaling.AzureStorage&version=10.3.1-alpha.1&prerelease
Microsoft Orleans Journaling for Azure Storage
Introduction
Microsoft Orleans Journaling for Azure Storage provides an Azure Storage implementation of the Orleans Journaling provider. This allows journaling and tracking of grain operations using Azure Storage as a backing store.
Blob names are derived from the configured journal storage identity and do not use journal format file extensions. Azure append blobs store the journal format key in blob metadata and, when the selected journal format provides a MIME type, are created with that content type. The WAL blob name and checkpoint blob name can be customized using AzureBlobJournalStorageOptions.GetWalBlobName and GetCheckpointBlobName.
Using an alternative blob layout
By default, WAL blobs are named <journalId>/wal and checkpoint blobs are named <journalId>/chk.<snapshotId>. Configure the blob name delegates to use an alternative layout, such as a shared prefix, file extensions, tenant-specific paths, or names which match an existing storage convention. Each delegate returns a container-relative blob name, and checkpoint names should include the supplied snapshot id to avoid collisions.
siloBuilder.AddAzureBlobJournalStorage(options =>
{
options.GetWalBlobName = static journalId => $"journals/{journalId.Value}.wal";
options.GetCheckpointBlobName = static (journalId, snapshotId) => $"journals/{journalId.Value}.{snapshotId}.chk";
});
Azure Table journal storage
The package also provides an Azure Table implementation, AddAzureTableJournalStorage. Each journal is stored as one table partition: a header row carries the journal manifest and is the optimistic concurrency fence, and journal bytes are stored in data rows whose keys order the current generation by sequence. Every append commits its rows together with the header update in a single entity group transaction, and recovery replays the whole journal with a single partition range query, avoiding the per-block pacing which append blob replay is subject to. Because an append is limited by entity group transaction limits, a single journal batch must not exceed 2 MiB; replace operations may be any size.
siloBuilder.AddAzureTableJournalStorage(options =>
{
options.TableName = "journal";
options.TableServiceClient = tableServiceClient;
});
AzureTableJournalStorageOptions.GetPartitionKey can be used to apply a custom partition layout. The returned key must be unique per journal, satisfy Azure Table partition-key restrictions, and contain at most 1,024 characters. The canonical journal id is stored in the header so catalog listing remains accurate with custom mappings.
Getting Started
To use this package, install it via NuGet:
dotnet add package Microsoft.Orleans.Journaling.AzureStorage
Example - Configuring Azure Storage Journaling
The journaling provider resolves a registered BlobServiceClient from DI. How you obtain that client depends on your hosting model.
Authentication options
For production workloads, prefer Microsoft Entra (Azure AD) credentials with DefaultAzureCredential rather than long-lived connection strings:
using Azure.Identity;
using Azure.Storage.Blobs;
using Microsoft.Extensions.DependencyInjection;
builder.Services.AddSingleton(_ =>
new BlobServiceClient(
new Uri("https://<your-account>.blob.core.windows.net"),
new DefaultAzureCredential()));
If you are integrating with .NET Aspire (as the bundled JournalingAzureBlobJson sample does), the AppHost emits a connection string that the consuming project resolves via AddAzureBlobServiceClient. Aspire wires up local emulator credentials in development and Entra-backed credentials in production.
For ad-hoc local development you may register a BlobServiceClient from a connection string (such as the Azurite UseDevelopmentStorage shortcut). Do not embed production connection strings in source.
Wiring it into the silo
using Microsoft.Extensions.Hosting;
using Orleans.Hosting;
using Orleans.Configuration;
using Orleans.Journaling.Json;
using System.Text.Json.Serialization;
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using MyGrainNamespace;
[JsonSerializable(typeof(DateTime))]
[JsonSerializable(typeof(int))]
[JsonSerializable(typeof(long))]
[JsonSerializable(typeof(string))]
[JsonSerializable(typeof(ulong))]
internal partial class JournalJsonContext : JsonSerializerContext;
var builder = Host.CreateApplicationBuilder(args)
.UseOrleans(siloBuilder =>
{
siloBuilder
.UseLocalhostClustering()
// Configure Azure Storage as a journaling provider
.AddAzureBlobJournalStorage(optionsBuilder =>
{
optionsBuilder.Configure((options, serviceProvider) => options.BlobServiceClient = serviceProvider.GetRequiredService<BlobServiceClient>());
})
// JSON Lines is the default journaling format. Register metadata for all journaled payload types.
.UseJsonJournalFormat(JournalJsonContext.Default);
});
var host = await builder.StartAsync();
// Get a reference to the grain
var shoppingCart = host.Services.GetRequiredService<IGrainFactory>()
.GetGrain<IShoppingCartGrain>("user1-cart");
// Use the grain
await shoppingCart.UpdateItem("apple", 5, 0);
await shoppingCart.UpdateItem("banana", 3, 1);
// Get and print the cart contents
var (contents, version) = await shoppingCart.GetCart();
Console.WriteLine($"Shopping cart (version {version}):");
foreach (var item in contents)
{
Console.WriteLine($"- {item.Key}: {item.Value}");
}
// Wait for the application to terminate
await host.WaitForShutdownAsync();
Example - Using Journaling in a Grain
using Orleans.Runtime;
namespace MyGrainNamespace;
public interface IShoppingCartGrain : IGrain
{
ValueTask<(bool success, long version)> UpdateItem(string itemId, int quantity, long version);
ValueTask<(Dictionary<string, int> Contents, long Version)> GetCart();
ValueTask<long> GetVersion();
ValueTask<(bool success, long version)> Clear(long version);
}
public class ShoppingCartGrain(
[FromKeyedServices("shopping-cart")] IDurableDictionary cart,
[FromKeyedServices("version")] IDurableValue<long> version) : DurableGrain, IShoppingCartGrain
{
private readonly IDurableValue<long> _version = version;
public async ValueTask<(bool success, long version)> UpdateItem(string itemId, int quantity, long version)
{
if (_version.Value != version)
{
// Conflict
return (false, _version.Value);
}
if (quantity == 0)
{
cart.Remove(itemId);
}
else
{
cart[itemId] = quantity;
}
_version.Value++;
await WriteStateAsync();
return (true, _version.Value);
}
public ValueTask<(Dictionary<string, int> Contents, long Version)> GetCart() => new((cart.ToDictionary(), _version.Value));
public ValueTask<long> GetVersion() => new(_version.Value);
public async ValueTask<(bool success, long version)> Clear(long version)
{
if (_version.Value != version)
{
// Conflict
return (false, _version.Value);
}
cart.Clear();
_version.Value++;
await WriteStateAsync();
return (true, _version.Value);
}
}
Documentation
For more comprehensive documentation, please refer to:
Feedback & Contributing
- If you have any issues or would like to provide feedback, please open an issue on GitHub
- Join our community on Discord
- Follow the @msftorleans Twitter account for Orleans announcements
- Contributions are welcome! Please review our contribution guidelines
- This project is licensed under the MIT license
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- Azure.Core (>= 1.51.1)
- Azure.Data.Tables (>= 12.11.0)
- Azure.Storage.Blobs (>= 12.27.0)
- Microsoft.AspNetCore.Connections.Abstractions (>= 10.0.3)
- Microsoft.CodeAnalysis.Analyzers (>= 3.11.0)
- Microsoft.CodeAnalysis.Common (>= 5.0.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 5.0.0)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
- Microsoft.Extensions.Configuration.Json (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.DependencyModel (>= 10.0.5)
- Microsoft.Extensions.Hosting (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Console (>= 10.0.5)
- Microsoft.Extensions.Logging.Debug (>= 10.0.5)
- Microsoft.Extensions.ObjectPool (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Microsoft.Orleans.Journaling (>= 10.3.1-alpha.1)
- Newtonsoft.Json (>= 13.0.4)
- Polly (>= 8.6.4)
- Polly.Extensions (>= 8.6.5)
- System.IO.Hashing (>= 10.0.3)
- System.Memory.Data (>= 10.0.3)
-
net8.0
- Azure.Core (>= 1.50.0)
- Azure.Data.Tables (>= 12.11.0)
- Azure.Storage.Blobs (>= 12.27.0)
- Microsoft.AspNetCore.Connections.Abstractions (>= 8.0.24)
- Microsoft.CodeAnalysis.Analyzers (>= 3.11.0)
- Microsoft.CodeAnalysis.Common (>= 4.5.0)
- Microsoft.CodeAnalysis.Workspaces.Common (>= 4.5.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.Configuration.Json (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.DependencyModel (>= 8.0.2)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Logging.Console (>= 8.0.1)
- Microsoft.Extensions.Logging.Debug (>= 8.0.1)
- Microsoft.Extensions.ObjectPool (>= 8.0.24)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Orleans.Journaling (>= 10.3.1-alpha.1)
- Newtonsoft.Json (>= 13.0.4)
- Polly (>= 8.6.4)
- Polly.Extensions (>= 8.6.5)
- System.IO.Hashing (>= 10.0.3)
- System.IO.Pipelines (>= 8.0.0)
- System.Memory.Data (>= 8.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Microsoft.Orleans.Journaling.AzureStorage:
| Package | Downloads |
|---|---|
|
Microsoft.Orleans.DurableJobs.AzureStorage
Microsoft Orleans durable jobs provider backed by Azure Blob Storage |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.3.1-alpha.1 | 54 | 8/28/2026 |
| 10.3.0-rc.1.alpha.1 | 61 | 8/25/2026 |
| 10.3.0-alpha.1 | 45 | 8/27/2026 |
| 10.2.2-rc.2.alpha.1 | 3,447 | 7/15/2026 |
| 10.2.2-rc.1.alpha.1 | 70 | 7/10/2026 |
| 10.2.2-alpha.1 | 83 | 7/21/2026 |
| 10.2.1-preview.1.alpha.1 | 229 | 6/19/2026 |
| 10.2.1-alpha.1 | 71 | 6/24/2026 |
| 10.2.0-alpha.1 | 426 | 6/12/2026 |
| 10.1.1-preview.1.alpha.1 | 78 | 5/13/2026 |
| 10.1.0-alpha.1 | 4,584 | 4/14/2026 |
| 10.0.1-alpha.1 | 13,312 | 2/7/2026 |
| 10.0.0-rc.2.alpha.1 | 187 | 12/31/2025 |
| 10.0.0-alpha.1 | 120 | 1/20/2026 |