![]() |
VOOZH | about |
dotnet add package Akka.Persistence.Azure --version 1.5.60
NuGet\Install-Package Akka.Persistence.Azure -Version 1.5.60
<PackageReference Include="Akka.Persistence.Azure" Version="1.5.60" />
<PackageVersion Include="Akka.Persistence.Azure" Version="1.5.60" />Directory.Packages.props
<PackageReference Include="Akka.Persistence.Azure" />Project file
paket add Akka.Persistence.Azure --version 1.5.60
#r "nuget: Akka.Persistence.Azure, 1.5.60"
#:package Akka.Persistence.Azure@1.5.60
#addin nuget:?package=Akka.Persistence.Azure&version=1.5.60Install as a Cake Addin
#tool nuget:?package=Akka.Persistence.Azure&version=1.5.60Install as a Cake Tool
Akka.Persistence implementation that uses Windows Azure table and blob storage.
Akka.Hosting can make configuring Akka.Persistence.Azure trivially easy and HOCON-less.
First, install the Akka.Persistence.Azure.Hosting NuGet package:
PS> install-package Akka.Persistence.Azure.Hosting
Next, add the WithAzurePersistence method calls to your AkkaConfigurationBuilder (from Akka.Hosting):
var conn = Environment.GetEnvironmentVariable("AZURE_CONNECTION_STR");
var host = new HostBuilder()
.ConfigureServices(collection =>
{
collection.AddAkka("MyActorSys", builder =>
{
// enables both journal and snapshot store
builder.WithAzurePersistence(conn);
builder.StartActors((system, registry) =>
{
var myActor = system.ActorOf(Props.Create(() => new MyPersistenceActor("ac1")), "actor1");
registry.Register<MyPersistenceActor>(myActor);
});
});
}).Build();
await host.StartAsync();
return host;
You can also call the following methods to activate the journal / snapshot stores independently:
WithAzureTableJournalWithAzureBlobsSnapshotStorevar host = new HostBuilder()
.ConfigureServices(collection =>
{
collection.AddAkka("MyActorSys", builder =>
{
var credentials = new DefaultAzureCredential();
// Add the journal table
builder.WithAzureTableJournal(
serviceUri: new Uri("https://{account_name}.table.core.windows.net"),
defaultAzureCredential: credentials);
// Add the snapshot-store blob container
builder.WithAzureBlobsSnapshotStore(
serviceUri: new Uri("https://{account_name}.blob.core.windows.net"),
defaultAzureCredential: credentials);
builder.StartActors((system, registry) =>
{
var myActor = system.ActorOf(Props.Create(() => new MyPersistenceActor("ac1")), "actor1");
registry.Register<MyPersistenceActor>(myActor);
});
});
}).Build();
await host.StartAsync();
return host;
WithAzureTableJournal and WithAzureBlobsSnapshotStore have an overload that allows you to use AzureTableStorageJournalSetup and AzureBlobSnapshotStoreSetup class respectively that allows you to configure all settings that are available in the HOCON settings. These setup classes also allows you to set Azure.Identity.DefaultAzureCredential programmatically.
There are two overload types that you can use, one by passing the Setup class instance directly, and the other using a delegate. Both have the same result at the end, use one that fits your programming style the best.
var host = new HostBuilder()
.ConfigureServices(collection =>
{
collection.AddAkka("MyActorSys", builder =>
{
var credentials = new DefaultAzureCredential();
// Programatically setup the journal table using delegate
builder.WithAzureTableJournal(setup =>
{
setup.TableName = "myazuretable";
setup.ServiceUri = new Uri("https://{account_name}.table.core.windows.net");
setup.DefaultAzureCredential = credentials;
// Optional TableClientOptions
setup.TableClientOptions = new TableClientOptions();
});
// You can also programatically pass in a Setup instance
/*
builder.WithAzureTableJournal(new AzureTableStorageJournalSetup
{
TableName = "myazuretable",
ServiceUri = new Uri("https://{account_name}.table.core.windows.net"),
DefaultAzureCredential = credentials,
// Optional TableClientOptions
TableClientOptions = new TableClientOptions()
});
*/
// Programatically setup the snapshot-store blob container using delegate
builder.WithAzureBlobsSnapshotStore(setup => {
setup.ContainerName = "myAzureBlobContainer";
setup.ServiceUri = new Uri("https://{account_name}.blob.core.windows.net");
setup.DefaultAzureCredential = credentials;
// Optional BlobClientOptions
setup.BlobClientOptions = new BlobClientOptions();
});
// You can also programatically pass in a Setup instance
/*
builder.WithAzureBlobsSnapshotStore(new AzureBlobSnapshotStoreSetup {
ContainerName = "myAzureBlobContainer",
ServiceUri = new Uri("https://{account_name}.blob.core.windows.net"),
DefaultAzureCredential = credentials,
// Optional BlobClientOptions
BlobClientOptions = new BlobClientOptions()
});
*/
builder.StartActors((system, registry) =>
{
var myActor = system.ActorOf(Props.Create(() => new MyPersistenceActor("ac1")), "actor1");
registry.Register<MyPersistenceActor>(myActor);
});
});
}).Build();
await host.StartAsync();
return host;
Starting with v1.5.51.1, you can enable health checks for Azure Table Storage journal and Blob Storage snapshots.
The standard health checks monitor the persistence plugins themselves and report their status:
builder.WithAzurePersistence(
connectionString: conn,
journalBuilder: journal => journal.WithHealthCheck(),
snapshotBuilder: snapshot => snapshot.WithHealthCheck());
Starting with v1.5.55, you can enable proactive connectivity health checks that verify Azure backend connectivity regardless of recent operation activity. This helps detect database outages during idle periods.
Using Akka.Hosting 1.5.55.1 or later:
var journalOptions = new AzureTableStorageJournalOptions(isDefault: true)
{
ConnectionString = connectionString,
TableName = "akkajournal",
AutoInitialize = true
};
var snapshotOptions = new AzureBlobSnapshotOptions(isDefault: true)
{
ConnectionString = connectionString,
ContainerName = "akka-snapshots",
AutoInitialize = true
};
builder
.WithAzureTableJournal(journalOptions, journal =>
{
journal.WithConnectivityCheck(); // Proactively verify Azure Table Storage connectivity
})
.WithAzureBlobsSnapshotStore(snapshotOptions, snapshot =>
{
snapshot.WithConnectivityCheck(); // Proactively verify Azure Blob Storage connectivity
});
Combining Standard and Connectivity Health Checks:
You can enable both types of health checks for comprehensive monitoring:
builder
.WithAzureTableJournal(journalOptions, journal =>
{
journal.WithHealthCheck(); // Monitor plugin status
journal.WithConnectivityCheck(); // Verify backend connectivity
})
.WithAzureBlobsSnapshotStore(snapshotOptions, snapshot =>
{
snapshot.WithHealthCheck(); // Monitor plugin status
snapshot.WithConnectivityCheck(); // Verify backend connectivity
});
The connectivity checks support all Azure SDK connection methods:
For more information on Akka.NET health checks, see the Akka.Hosting health check documentation.
Here is a default configuration used by this plugin: https://github.com/petabridge/Akka.Persistence.Azure/blob/dev/src/Akka.Persistence.Azure/reference.conf
You will need to provide connection string and Azure Table name for journal, and connection string with container name for Azure Blob Store:
# Need to enable plugin
akka.persistence.journal.plugin = akka.persistence.journal.azure-table
akka.persistence.snapshot-store.plugin = akka.persistence.snapshot-store.azure-blob-store
# Configure journal
akka.persistence.journal.azure-table.connection-string = "Your Azure Storage connection string"
akka.persistence.journal.azure-table.table-name = "Your table name"
# Configure snapshots
akka.persistence.snapshot-store.azure-blob-store.connection-string = "Your Azure Storage connection string"
akka.persistence.snapshot-store.azure-blob-store.container-name = "Your container name"
Since there is no way to pass in DefaultAzureCredential through HOCON settings, this has to be done programatically using Setup classes.
// Need to enable plugin
var config = ConfigurationFactory.ParseString(@"
akka.persistence.journal.plugin = akka.persistence.journal.azure-table
akka.persistence.snapshot-store.plugin = akka.persistence.snapshot-store.azure-blob-store");
var credentials = new DefaultAzureCredential();
var setup = BootstrapSetup.Create()
.WithConfig(config)
// Add DefaultAzureCredential to snapshot-store using Setup class
.And(new AzureBlobSnapshotSetup
{
ServiceUri = new Uri("https://{account_name}.blob.core.windows.net"),
DefaultAzureCredential = credentials,
BlobClientOptions = new BlobClientOptions() // Optional
})
// Add DefaultAzureCredential to journal table using Setup class
.And(new AzureTableStorageJournalSetup
{
ServiceUri = new Uri("https://{account_name}.table.core.windows.net"),
DefaultAzureCredential = credentials,
TableClientOptions = new TableClientOptions() // Optional
});
var myActorSystem = ActorSystem.Create("myActorSystem", setup);
You can turn local development mode by changing these two settings:
akka.persistence.journal.azure-table.development = on
akka.persistence.snapshot-store.azure-blob-store.development = on
When set, the plugin will ignore the connection-string setting and uses the Azure Storage Emulator default connection string of "UseDevelopmentStorage=true" instead.
Blob container auto-initialize behaviour can be changed by changing this flag setting:
# Creates the required container if set
akka.persistence.snapshot-store.azure-blob-store.auto-initialize = on
Auto-initialized blob container public access type can be controlled by changing this setting:
# Public access level for the auto-initialized storage container.
# Valid values are "None", "BlobContainer" or "Blob"
akka.persistence.snapshot-store.azure-blob-store.container-public-access-type = "None"
Azure.Identity DefaultAzureCredential can be used to configure the resource by using AzureBlobSnapshotSetup. When using DefaultAzureCredential, the HOCON 'connection-string' setting is ignored.
Example:
var blobStorageSetup = AzureBlobSnapshotSetup.Create(
new Uri("https://{account_name}.blob.core.windows.net"), // This is the blob service URI
new DefaultAzureCredential() // You can pass a DefaultAzureCredentialOption here.
// https://docs.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential?view=azure-dotnet
);
var bootstrap = BootstrapSetup.Create().And(blobStorageSetup);
var system = ActorSystem.Create("actorSystem", bootstrap);
You can use this plugin with Azure Storage Emulator in a local development environment by setting the development flag in the configuration file:
akka.persistence.journal.azure-table.development = on
akka.persistence.snapshot-store.azure-blob-store.development = on
you do not need to provide a connection string for this to work, it is handled automatically by the Microsoft Azure SDK.
To run the build script associated with this solution, execute the following:
Windows
c:\> build.cmd all
Linux / OS X
c:\> build.sh all
If you need any information on the supported commands, please execute the build.[cmd|sh] help command.
This build script is powered by FAKE; please see their API documentation should you need to make any changes to the file.
The attached build script will automatically do the following based on the conventions of the project names added to this project:
.Tests will automatically be treated as a XUnit2 project and will be included during the test stages of this build script;.Tests will automatically be treated as a NBench project and will be included during the test stages of this build script; and.nupkg file will automatically be placed in the bin\nuget folder upon running the build.[cmd|sh] all command.This solution also supports DocFx for generating both API documentation and articles to describe the behavior, output, and usages of your project.
All of the relevant articles you wish to write should be added to the /docs/articles/ folder and any API documentation you might need will also appear there.
All of the documentation will be statically generated and the output will be placed in the /docs/_site/ folder.
To preview the documentation for this project, execute the following command at the root of this folder:
C:\> serve-docs.cmd
This will use the built-in docfx.console binary that is installed as part of the NuGet restore process from executing any of the usual build.cmd or build.sh steps to preview the fully-rendered documentation. For best results, do this immediately after calling build.cmd buildRelease.
This project will automatically populate its release notes in all of its modules via the entries written inside and will automatically update the versions of all assemblies and NuGet packages via the metadata included inside .
If you add any new projects to the solution created with this template, be sure to add the following line to each one of them in order to ensure that you can take advantage of common.props for standardization purposes:
<Import Project="..\common.props" />
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 1 NuGet packages that depend on Akka.Persistence.Azure:
| Package | Downloads |
|---|---|
|
Akka.Persistence.Azure.Hosting
Akka.Hosting support for Akka.Persistence.Azure. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.60 | 10,236 | 2/10/2026 |
| 1.5.59 | 757 | 1/27/2026 |
| 1.5.55.1 | 5,360 | 11/17/2025 |
| 1.5.55.1-beta1 | 284 | 10/31/2025 |
| 1.5.55 | 4,434 | 10/27/2025 |
| 1.5.53 | 2,449 | 10/15/2025 |
| 1.5.51.1 | 2,147 | 10/2/2025 |
| 1.5.51 | 656 | 10/1/2025 |
| 1.5.49 | 2,613 | 9/15/2025 |
| 1.5.45 | 5,161 | 7/10/2025 |
| 1.5.44 | 764 | 6/26/2025 |
| 1.5.42 | 4,880 | 5/22/2025 |
| 1.5.40 | 3,453 | 4/7/2025 |
| 1.5.38 | 3,391 | 3/11/2025 |
| 1.5.32.1 | 7,677 | 12/23/2024 |
| 1.5.32 | 682 | 12/19/2024 |
| 1.5.31 | 2,344 | 12/3/2024 |
| 1.5.28 | 647 | 12/2/2024 |
| 1.5.26 | 19,335 | 7/4/2024 |
| 1.5.19 | 6,015 | 4/24/2024 |
* [Update Akka.NET v1.5.59](https://github.com/akkadotnet/akka.net/releases/tag/1.5.59)
* [Update Akka.Hosting v1.5.59](https://github.com/akkadotnet/Akka.Hosting/releases/tag/1.5.59)