Microsoft.Orleans.Persistence.AzureStorage
9.2.0-preview3
Prefix Reserved
dotnet add package Microsoft.Orleans.Persistence.AzureStorage --version 9.2.0-preview3
NuGet\Install-Package Microsoft.Orleans.Persistence.AzureStorage -Version 9.2.0-preview3
<PackageReference Include="Microsoft.Orleans.Persistence.AzureStorage" Version="9.2.0-preview3" />
<PackageVersion Include="Microsoft.Orleans.Persistence.AzureStorage" Version="9.2.0-preview3" />
<PackageReference Include="Microsoft.Orleans.Persistence.AzureStorage" />
paket add Microsoft.Orleans.Persistence.AzureStorage --version 9.2.0-preview3
#r "nuget: Microsoft.Orleans.Persistence.AzureStorage, 9.2.0-preview3"
#addin nuget:?package=Microsoft.Orleans.Persistence.AzureStorage&version=9.2.0-preview3&prerelease
#tool nuget:?package=Microsoft.Orleans.Persistence.AzureStorage&version=9.2.0-preview3&prerelease
Microsoft Orleans Persistence for Azure Storage
Introduction
Microsoft Orleans Persistence for Azure Storage provides grain persistence for Microsoft Orleans using Azure Storage (Blob and Table). This allows your grains to persist their state in Azure Storage and reload it when they are reactivated.
Getting Started
To use this package, install it via NuGet:
dotnet add package Microsoft.Orleans.Persistence.AzureStorage
Example - Configuring Azure Storage Persistence
using Microsoft.Extensions.Hosting;
using Orleans.Configuration;
using Orleans.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;
// Define grain interface
public interface IMyGrain : IGrainWithStringKey
{
Task SetData(string data);
Task<string> GetData();
}
var builder = Host.CreateApplicationBuilder(args)
.UseOrleans(siloBuilder =>
{
siloBuilder
.UseLocalhostClustering()
// Configure Azure Table Storage as grain storage
.AddAzureTableGrainStorage(
name: "tableStore",
configureOptions: options =>
{
options.ConnectionString = "YOUR_AZURE_STORAGE_CONNECTION_STRING";
})
// Configure Azure Blob Storage as grain storage
.AddAzureBlobGrainStorage(
name: "blobStore",
configureOptions: options =>
{
options.ConnectionString = "YOUR_AZURE_STORAGE_CONNECTION_STRING";
});
});
var host = builder.Build();
await host.StartAsync();
// Get a reference to a grain and call it
var client = host.Services.GetRequiredService<IClusterClient>();
var grain = client.GetGrain<IMyGrain>("user123");
await grain.SetData("Hello from Azure Storage!");
var response = await grain.GetData();
// Print the result
Console.WriteLine($"Grain data: {response}");
// Keep the host running until the application is shut down
await host.WaitForShutdownAsync();
Example - Using Grain Storage in a Grain
using System;
using System.Threading.Tasks;
using Orleans;
using Orleans.Runtime;
namespace ExampleGrains;
// Define grain state class
public class MyGrainState
{
public string Data { get; set; }
public int Version { get; set; }
}
// Grain implementation that uses the Azure storage
public class MyGrain : Grain, IMyGrain, IGrainWithStringKey
{
private readonly IPersistentState<MyGrainState> _state;
public MyGrain([PersistentState("state", "tableStore")] IPersistentState<MyGrainState> state)
{
_state = state;
}
public async Task SetData(string data)
{
_state.State.Data = data;
_state.State.Version++;
await _state.WriteStateAsync();
}
public Task<string> GetData()
{
return Task.FromResult(_state.State.Data);
}
}
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 was computed. 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. |
-
net8.0
- Azure.Core (>= 1.44.1)
- Azure.Data.Tables (>= 12.9.1)
- Azure.Storage.Blobs (>= 12.23.0)
- Microsoft.AspNetCore.Connections.Abstractions (>= 8.0.11)
- 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.2)
- Microsoft.Extensions.Logging.Console (>= 8.0.1)
- Microsoft.Extensions.Logging.Debug (>= 8.0.1)
- Microsoft.Extensions.ObjectPool (>= 8.0.11)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 8.0.0)
- Microsoft.Orleans.Analyzers (>= 9.2.0-preview3)
- Microsoft.Orleans.CodeGenerator (>= 9.2.0-preview3)
- Microsoft.Orleans.Runtime (>= 9.2.0-preview3)
- Newtonsoft.Json (>= 13.0.3)
- System.Collections.Immutable (>= 8.0.0)
- System.IO.Hashing (>= 8.0.0)
- System.IO.Pipelines (>= 8.0.0)
- System.Memory.Data (>= 8.0.1)
- System.Net.NameResolution (>= 4.3.0)
- System.Text.Json (>= 8.0.5)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Microsoft.Orleans.Persistence.AzureStorage:
Package | Downloads |
---|---|
Blauhaus.Orleans
Package Description |
|
Blauhaus.EVACS.Orleans
Package Description |
|
Microsoft.Orleans.OrleansAzureUtils
Support library for hosting Orleans on Microsoft Azure. |
|
Orleans.Contrib.UniversalSilo
This library provides primitives to set up a configurable, application-agnostic Orleans silo and clients. Use it with the Orleans.Contrib.UniversalSilo.Templates to get started with Orleans. |
|
Microsoft.Orleans.Persistence.AzureStorage.Migration
Microsoft Orleans persistence migration providers for Azure Storage |
GitHub repositories (8)
Showing the top 8 popular GitHub repositories that depend on Microsoft.Orleans.Persistence.AzureStorage:
Repository | Stars |
---|---|
dotnet/aspire
Tools, templates, and packages to accelerate building observable, production-ready apps
|
|
dotnet/samples
Sample code referenced by the .NET documentation
|
|
Dotnet-Boxed/Templates
.NET project templates with batteries included, providing the minimum amount of code required to get you going faster.
|
|
microsoft/dotnet-podcasts
.NET reference application shown at .NET Conf featuring ASP.NET Core, Blazor, .NET MAUI, Microservices, Orleans, Playwright, and more!
|
|
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
|
|
Samsung/Tizen.NET
Welcome to Tizen .NET
|
|
J-Tech-Japan/Sekiban
Sekiban - an Opinionated Event Sourcing and CQRS Framework using C#. It can store data into Azure Cosmos DB, AWS Dynamo DB or Postgres
|
|
ReubenBond/hanbaobao-web
Orleans sample application with Kubernetes hosting
|
Version | Downloads | Last Updated |
---|---|---|
9.2.0-preview3 | 321 | 6/10/2025 |
9.2.0-preview2 | 142 | 6/4/2025 |
9.2.0-preview1 | 3,954 | 4/4/2025 |
9.1.2 | 70,173 | 2/13/2025 |
9.0.1 | 35,872 | 11/23/2024 |
9.0.0 | 3,379 | 11/14/2024 |
8.2.0 | 131,406 | 7/12/2024 |
8.2.0-preview1 | 297 | 5/22/2024 |
8.1.0 | 111,370 | 4/17/2024 |
8.1.0-preview3 | 1,064 | 3/11/2024 |
8.1.0-preview2 | 199 | 2/23/2024 |
8.1.0-preview1 | 1,286 | 2/13/2024 |
8.0.0 | 49,999 | 1/5/2024 |
8.0.0-rc2 | 319 | 12/20/2023 |
8.0.0-rc1 | 324 | 12/4/2023 |
7.2.7 | 2,522 | 10/15/2024 |
7.2.6 | 10,672 | 3/9/2024 |
7.2.5 | 5,243 | 2/22/2024 |
7.2.4 | 28,312 | 12/2/2023 |
7.2.3 | 16,928 | 11/3/2023 |
7.2.2 | 9,592 | 10/16/2023 |
7.2.1 | 77,392 | 7/11/2023 |
7.2.0 | 3,027 | 7/7/2023 |
7.1.2 | 37,172 | 4/19/2023 |
7.1.1 | 19,909 | 3/23/2023 |
7.1.0 | 35,718 | 2/1/2023 |
7.0.0 | 18,963 | 11/8/2022 |
7.0.0-rc2 | 596 | 10/19/2022 |
4.0.0-preview2 | 4,073 | 8/4/2022 |
4.0.0-preview1 | 2,534 | 2/10/2022 |
3.8.0 | 672 | 5/6/2025 |
3.8.0-preview5 | 225 | 5/12/2025 |
3.8.0-preview3 | 189 | 4/8/2025 |
3.8.0-preview2 | 141 | 4/4/2025 |
3.8.0-preview1 | 189 | 3/31/2025 |
3.7.2 | 17,273 | 5/10/2024 |
3.7.1 | 63,320 | 5/27/2023 |
3.7.0 | 62,546 | 3/23/2023 |
3.6.5 | 565,105 | 8/15/2022 |
3.6.4 | 17,026 | 8/10/2022 |
3.6.3 | 38,635 | 8/4/2022 |
3.6.2 | 570,029 | 4/15/2022 |
3.6.1 | 19,105 | 4/5/2022 |
3.6.0 | 105,887 | 1/20/2022 |
3.5.1 | 88,666 | 11/8/2021 |
3.5.0 | 88,179 | 9/3/2021 |
3.4.4 | 1,891 | 10/4/2021 |
3.4.3 | 61,297 | 6/3/2021 |
3.4.2 | 49,219 | 4/5/2021 |
3.4.1 | 41,584 | 2/3/2021 |
3.4.0 | 16,536 | 1/6/2021 |
3.4.0-rc1 | 588 | 12/9/2020 |
3.3.0 | 37,315 | 9/9/2020 |
3.3.0-rc2 | 1,639 | 9/2/2020 |
3.3.0-rc1 | 589 | 8/19/2020 |
3.2.2 | 11,486 | 7/22/2020 |
3.2.1 | 5,068 | 7/2/2020 |
3.2.0 | 6,894 | 6/4/2020 |
3.2.0-rc2 | 767 | 5/20/2020 |
3.2.0-rc1 | 774 | 5/7/2020 |
3.1.7 | 6,201 | 5/19/2020 |
3.1.6 | 19,394 | 4/16/2020 |
3.1.5 | 1,199 | 4/9/2020 |
3.1.4 | 18,414 | 3/26/2020 |
3.1.3 | 6,001 | 3/16/2020 |
3.1.2 | 4,367 | 3/5/2020 |
3.1.0 | 2,801 | 2/23/2020 |
3.1.0-rc3 | 659 | 2/13/2020 |
3.1.0-rc2 | 666 | 2/12/2020 |
3.1.0-rc1 | 680 | 2/10/2020 |
3.0.2 | 19,172 | 12/12/2019 |
3.0.1 | 2,913 | 11/27/2019 |
3.0.0 | 7,894 | 10/24/2019 |
3.0.0-rc2 | 727 | 10/16/2019 |
3.0.0-rc1 | 699 | 10/9/2019 |
3.0.0-beta1 | 1,074 | 8/16/2019 |
2.4.5 | 5,683 | 12/29/2019 |
2.4.4 | 12,309 | 11/27/2019 |
2.4.3 | 12,507 | 10/10/2019 |
2.4.2 | 8,085 | 8/31/2019 |
2.4.1 | 4,666 | 8/14/2019 |
2.4.0 | 5,106 | 8/8/2019 |
2.3.6 | 24,134 | 7/24/2019 |
2.3.5 | 15,286 | 6/14/2019 |
2.3.4 | 3,658 | 6/4/2019 |
2.3.3 | 2,484 | 6/2/2019 |
2.3.2 | 4,249 | 5/9/2019 |
2.3.1 | 3,110 | 4/26/2019 |
2.3.0 | 10,397 | 3/20/2019 |
2.3.0-rc2 | 2,066 | 3/13/2019 |
2.3.0-rc1 | 1,879 | 3/4/2019 |
2.2.4 | 4,215 | 2/25/2019 |
2.2.3 | 4,181 | 1/17/2019 |
2.2.0 | 9,707 | 12/13/2018 |
2.2.0-rc1 | 2,134 | 12/4/2018 |
2.2.0-beta1 | 2,241 | 10/21/2018 |
2.1.2 | 14,911 | 10/11/2018 |
2.1.0 | 4,260 | 9/28/2018 |
2.1.0-rc2 | 2,602 | 9/21/2018 |
2.1.0-rc1 | 2,585 | 9/14/2018 |
2.1.0-beta1 | 7,420 | 8/27/2018 |
2.0.3 | 8,621 | 6/15/2018 |
2.0.0 | 15,580 | 3/28/2018 |
2.0.0-rc2 | 3,093 | 3/13/2018 |
2.0.0-rc1 | 4,092 | 2/26/2018 |
2.0.0-beta3 | 4,586 | 12/21/2017 |
2.0.0-beta2 | 3,009 | 12/11/2017 |