Akka.Aspire
1.5.73
Prefix Reserved
See the version list below for details.
dotnet add package Akka.Aspire --version 1.5.73
NuGet\Install-Package Akka.Aspire -Version 1.5.73
<PackageReference Include="Akka.Aspire" Version="1.5.73" />
<PackageVersion Include="Akka.Aspire" Version="1.5.73" />
<PackageReference Include="Akka.Aspire" />
paket add Akka.Aspire --version 1.5.73
#r "nuget: Akka.Aspire, 1.5.73"
#:package Akka.Aspire@1.5.73
#addin nuget:?package=Akka.Aspire&version=1.5.73
#tool nuget:?package=Akka.Aspire&version=1.5.73
Akka.Aspire
.NET Aspire service (client) integration for Akka.NET clusters. Call WithAspireClusterBootstrap
in your service and it configures Akka.Remote, Akka.Cluster, Akka.Management, Cluster Bootstrap, and a
cluster-membership health check from the configuration that the
Akka.Aspire.Hosting AppHost package injects —
no manual HOCON required.
Installation
dotnet add package Akka.Aspire
Usage (service)
using Akka.Aspire;
using Akka.Discovery.Redis;
using Akka.Hosting;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAkka("MySystem", (akkaBuilder, sp) =>
{
akkaBuilder.WithAspireClusterBootstrap(sp,
configureDiscovery: (b, config) =>
{
// The AppHost injects the discovery resource's name; fall back to a literal for clarity.
var connectionStringName = config["Akka:Cluster:Clustering:ConnectionStringName"] ?? "akka-discovery";
var redisConn = config.GetConnectionString(connectionStringName);
if (!string.IsNullOrEmpty(redisConn))
b.WithRedisDiscovery(redisConn, config["Akka:Cluster:ServiceName"]);
},
clusterConfigure: c => c.Roles = ["my-service"]);
});
builder.Services.AddHealthChecks();
var app = builder.Build();
app.MapHealthChecks("/healthz");
app.MapGet("/", () => "Hello from Akka.NET Aspire!");
app.Run();
WithAspireClusterBootstrap reads the Aspire-injected environment variables and stands up the full
cluster stack. The configureDiscovery callback wires the discovery plugin using the same
IConfiguration that Aspire populates, and clusterConfigure sets roles and other cluster options.
Corresponding AppHost (Akka.Aspire.Hosting)
The service above consumes the configuration that the
Akka.Aspire.Hosting AppHost injects. The
matching AppHost declares the discovery backend and the cluster, then wires this service to it with
WithReference:
using Akka.Aspire.Hosting;
var builder = DistributedApplication.CreateBuilder(args);
// The discovery backend the service's `WithRedisDiscovery` connects to. Its resource name
// ("akka-discovery") surfaces on the service side as `Akka:Cluster:Clustering:ConnectionStringName`,
// so the two halves stay in sync automatically.
var redis = builder.AddRedis("akka-discovery");
// Declare the cluster and bind its discovery backend (the provider type is auto-detected).
var akka = builder.AddAkka("my-cluster")
.WithClustering(redis);
// Every replica wired with WithReference discovers its peers and forms the cluster.
builder.AddProject<Projects.MyService>("service")
.WithHttpEndpoint(name: "http")
.WithReplicas(3)
.WithReference(akka);
builder.Build().Run();
See the Akka.Aspire.Hosting
README for the full set of injected settings and supported discovery backends, and
src/aspire/examples/ for complete runnable Redis and Azure Table Storage samples.
Swapping discovery providers
Only the AppHost resource and the configureDiscovery callback change between environments — the rest
of the service stays identical.
Azure Table Storage (local dev via Azurite, production via real Azure):
akkaBuilder.WithAspireClusterBootstrap(sp,
configureDiscovery: (b, config) =>
{
var name = config["Akka:Cluster:Clustering:ConnectionStringName"] ?? "akka-discovery";
var conn = config.GetConnectionString(name);
if (!string.IsNullOrEmpty(conn))
b.WithAzureDiscovery(conn, config["Akka:Cluster:ServiceName"]);
},
clusterConfigure: c => c.Roles = ["my-service"]);
Kubernetes (no connection string needed):
akkaBuilder.WithAspireClusterBootstrap(sp,
configureDiscovery: (b, config) => b.WithKubernetesDiscovery(),
clusterConfigure: c => c.Roles = ["my-service"]);
Health checks
WithAspireClusterBootstrap registers a cluster-membership health check tagged readiness, so a
/healthz/ready probe reports Healthy only once the node has joined the cluster (MemberStatus.Up):
app.MapHealthChecks("/healthz/ready",
new HealthCheckOptions { Predicate = c => c.Tags.Contains("readiness") });
Learn more
License
Apache-2.0
| Product | Versions 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. |
-
net10.0
- Akka (>= 1.5.73)
- Akka.Cluster.Hosting (>= 1.5.73)
- Akka.Hosting (>= 1.5.73)
- Akka.Management (>= 1.5.73)
- Akka.Remote.Hosting (>= 1.5.73)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.2)
- OpenTelemetry.Api (>= 1.15.3)
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 |
|---|---|---|
| 1.6.0-beta3 | 29 | 10/7/2026 |
| 1.5.73 | 62 | 10/5/2026 |
| 1.5.70 | 598 | 8/18/2026 |
* Update to [Akka.NET v1.5.73](https://github.com/akkadotnet/akka.net/releases/tag/1.5.73)
* Update to [Akka.Hosting v1.5.73](https://github.com/akkadotnet/Akka.Hosting/releases/tag/1.5.73)
* Update to the 1.5.72/1.5.73 [Akka.TestKit.Xunit `IAsyncLifetime` breaking change](https://github.com/akkadotnet/akka.net/pull/8545) — `TestKit` now implements `InitializeAsync`/`DisposeAsync` directly. Derived test specs that declare their own must mark them `override` and chain to the base method, or the build fails with `CS0114`. Updated the affected Azure and Redis test specs accordingly. ([#3479](https://github.com/akkadotnet/Akka.Management/pull/3479))