Repository navigation
feat(aspire): integrate Orleans providers end to end - #10798
ReubenBond wants to merge 41 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Extends Orleans’ Aspire story so first-party providers can be activated end-to-end from Aspire-generated configuration (AppHost → environment/config → UseOrleans/UseOrleansClient provider activation), with accompanying live/app-model tests and updated documentation across Azure, Redis, ADO.NET, NATS, and AWS (DynamoDB/Kinesis).
Changes:
- Adds/extends configuration-driven provider builders (including stable provider aliases) for multiple providers, and enables configuration-driven grain journaling activation in default silo wiring.
- Adds Aspire app-model and live-provider integration tests across Azure Storage, Cosmos DB, Redis, NATS JetStream, ADO.NET databases, and AWS DynamoDB/Kinesis scenarios.
- Updates docs/snippets to reflect the new Aspire/provider configuration contract, including an updated provider wiring matrix and new DynamoDB-with-Aspire guidance.
Show a summary per file
| File | Description |
|---|---|
| test/Orleans.Core.Tests/ProviderErrorMessageTests.cs | Adds coverage for configuration-driven grain journaling provider activation error messaging. |
| test/Extensions/Orleans.Streaming.NATS.Tests/Orleans.Streaming.NATS.Tests.csproj | Adds Aspire test dependencies/capabilities gated by TFM. |
| test/Extensions/Orleans.Streaming.NATS.Tests/NatsStreamProviderBuilderTests.cs | Validates NATS provider builder binding, aliases, and error paths. |
| test/Extensions/Orleans.Streaming.NATS.Tests/NatsAspireIntegrationTests.cs | Adds Aspire app-model + live JetStream tests for NATS streaming. |
| test/Extensions/Orleans.Streaming.Kinesis.Tests/KinesisAspireIntegrationTests.cs | Adds Aspire-style configuration binding tests for Kinesis streaming and checkpointing. |
| test/Extensions/Orleans.Streaming.EventHubs.Tests/EventHubsAspireIntegrationTests.cs | Extends Event Hubs Aspire tests to include client configuration and live connectivity. |
| test/Extensions/Orleans.Redis.Tests/RedisAspireIntegrationTests.cs | Adds Aspire app-model + live activation tests across Redis capabilities (incl. journaling path). |
| test/Extensions/Orleans.Redis.Tests/Orleans.Redis.Tests.csproj | Adds Aspire test dependencies/capabilities gated by TFM. |
| test/Extensions/Orleans.Cosmos.Tests/Orleans.Cosmos.Tests.csproj | Adds Aspire test dependencies/capabilities gated by TFM. |
| test/Extensions/Orleans.Cosmos.Tests/CosmosAspireIntegrationTests.cs | Adds Aspire app-model + live tests for Cosmos clustering/storage/reminders. |
| test/Extensions/Orleans.Azure.Tests/Orleans.Azure.Tests.csproj | Adds Aspire test dependencies/capabilities gated by TFM. |
| test/Extensions/Orleans.Azure.Tests/AzureStorageAspireIntegrationTests.cs | Adds Aspire app-model + live tests for Azure Tables/Blobs/Queues provider activation. |
| test/Extensions/Orleans.AWS.Tests/DynamoDBProviderBuilderTests.cs | Adds comprehensive binding/precedence/validation/redaction tests for DynamoDB provider config shapes. |
| test/Extensions/Orleans.AdoNet.Tests/Orleans.AdoNet.Tests.csproj | Adds Aspire test dependencies/capabilities gated by TFM. |
| test/Extensions/Orleans.AdoNet.Tests/AdoNetAspireTestConfiguration.cs | Adds shared Aspire test model to generate ADO.NET provider configuration across DBs/capabilities. |
| test/Extensions/Orleans.AdoNet.Tests/AdoNetAspireIntegrationTests.cs | Validates generated config activates ADO.NET providers + invariant inference/override shapes. |
| src/Redis/Orleans.Streaming.Redis/Hosting/RedisStreamingProviderBuilder.cs | Adds Azure Managed Redis provider aliases for Redis streaming. |
| src/Redis/Orleans.Reminders.Redis/Hosting/RedisRemindersProviderBuilder.cs | Adds Azure Managed Redis provider alias for Redis reminders. |
| src/Redis/Orleans.Persistence.Redis/Hosting/RedisGrainStorageProviderBuilder.cs | Adds Azure Managed Redis provider alias for Redis grain storage. |
| src/Redis/Orleans.Journaling.Redis/RedisGrainJournalingProviderBuilder.cs | Adds Redis journaling provider aliases for Azure Redis Cache/Azure Managed Redis. |
| src/Redis/Orleans.GrainDirectory.Redis/Hosting/RedisGrainDirectoryProviderBuilder.cs | Adds Azure Managed Redis provider alias for Redis grain directory. |
| src/Redis/Orleans.Clustering.Redis/Hosting/RedisClusteringProviderBuilder.cs | Adds Azure Managed Redis provider aliases for Redis clustering (silo/client). |
| src/Orleans.Streaming.NATS/README.md | Documents Aspire integration and keyed connection registration for NATS streaming. |
| src/Orleans.Streaming.NATS/Providers/NatsConnectionManager.cs | Updates connection management to support shared keyed INatsConnection and serializer registry handling. |
| src/Orleans.Streaming.NATS/NatsOptions.cs | Adds internal shared-connection hook and strengthens option validation. |
| src/Orleans.Streaming.NATS/Hosting/NatsStreamProviderBuilder.cs | Adds config-driven NATS stream provider builder + stable aliases and connection binding rules. |
| src/Orleans.Runtime/Hosting/DefaultSiloServices.cs | Enables applying configuration-driven Orleans:GrainJournaling section during silo startup. |
| src/Azure/Orleans.Reminders.Cosmos/CosmosRemindersProviderBuilder.cs | Adds config-driven Cosmos reminders provider builder with keyed client/connection string paths. |
| src/AWS/Shared/Storage/DynamoDBStorage.cs | Refactors DynamoDB client creation to correctly handle service URL vs region + explicit credentials. |
| src/AWS/Shared/Storage/DynamoDBProviderConfiguration.cs | Introduces shared configuration binding/precedence logic for DynamoDB providers (resource outputs, env, conn strings). |
| src/AWS/Shared/Storage/DynamoDBClientOptions.cs | Redacts DynamoDB session token in option formatting. |
| src/AWS/Orleans.Streaming.Kinesis/README.md | Documents configuration-driven hosting + aliases and Aspire-style resource binding for Kinesis. |
| src/AWS/Orleans.Streaming.Kinesis/Hosting/KinesisStreamProviderBuilder.cs | Adds config-driven Kinesis streaming provider builder with grain/DynamoDB checkpoint selection. |
| src/AWS/Orleans.Reminders.DynamoDB/Reminders/DynamoDbReminderStorageOptions.cs | Adds DynamoDB reminder options validator using shared validation logic. |
| src/AWS/Orleans.Reminders.DynamoDB/README.md | Adds Aspire guidance link for DynamoDB reminders. |
| src/AWS/Orleans.Reminders.DynamoDB/Orleans.Reminders.DynamoDB.csproj | Links shared DynamoDB provider configuration source into reminders project. |
| src/AWS/Orleans.Reminders.DynamoDB/DynamoDBServiceCollectionReminderExtensions.cs | Registers reminder options validator and formatter. |
| src/AWS/Orleans.Reminders.DynamoDB/DynamoDBRemindersProviderBuilder.cs | Updates reminders provider builder to use shared DynamoDB configuration binding logic. |
| src/AWS/Orleans.Persistence.DynamoDB/README.md | Adds Aspire guidance link and updates examples around Service/capacity settings. |
| src/AWS/Orleans.Persistence.DynamoDB/Orleans.Persistence.DynamoDB.csproj | Links shared DynamoDB provider configuration source into persistence project. |
| src/AWS/Orleans.Persistence.DynamoDB/Options/DynamoDBStorageOptions.cs | Replaces ad-hoc validation with shared DynamoDB table/client validation. |
| src/AWS/Orleans.Persistence.DynamoDB/Hosting/DynamoDBGrainStorageProviderBuilder.cs | Updates grain storage builder to use shared DynamoDB configuration binding logic. |
| src/AWS/Orleans.Clustering.DynamoDB/README.md | Adds Aspire guidance link and updates examples around Service/capacity settings. |
| src/AWS/Orleans.Clustering.DynamoDB/Orleans.Clustering.DynamoDB.csproj | Links shared DynamoDB provider configuration source into clustering project. |
| src/AWS/Orleans.Clustering.DynamoDB/Options/DynamoDBGatewayOptions.cs | Adds gateway options validator using shared validation logic. |
| src/AWS/Orleans.Clustering.DynamoDB/Options/DynamoDBClusteringOptions.cs | Adds clustering options validator using shared validation logic. |
| src/AWS/Orleans.Clustering.DynamoDB/DynamoDBClusteringProviderBuilder.cs | Updates clustering builder to use shared DynamoDB configuration binding logic. |
| src/AWS/Orleans.Clustering.DynamoDB/AWSUtilsHostingExtensions.cs | Registers clustering/gateway validators and formatters. |
| src/api/Orleans.Streaming.NATS/Orleans.Streaming.NATS.cs | Updates generated public API surface for new NATS provider builder type. |
| src/AdoNet/Shared/Storage/AdoNetProviderConfiguration.cs | Adds shared inference for ADO.NET invariant + connection-string resolution for Aspire resource types. |
| src/AdoNet/Orleans.Streaming.AdoNet/Hosting/AdoNetStreamingProviderBuilder.cs | Adds config-driven ADO.NET streaming provider builder + Aspire DB aliases. |
| src/AdoNet/Orleans.Reminders.AdoNet/AdoNetRemindersProviderBuilder.cs | Adds Aspire DB aliases and uses shared invariant/connection binding. |
| src/AdoNet/Orleans.Persistence.AdoNet/AdoNetGrainStorageProviderBuilder.cs | Adds Aspire DB aliases and uses shared invariant/connection binding. |
| src/AdoNet/Orleans.GrainDirectory.AdoNet/Hosting/AdoNetGrainDirectoryProviderBuilder.cs | Adds Aspire DB aliases and uses shared invariant/connection binding. |
| src/AdoNet/Orleans.Clustering.AdoNet/AdoNetClusteringProviderBuilder.cs | Adds Aspire DB aliases and uses shared invariant/connection binding. |
| samples/JournalingAzureBlobJson/README.md | Clarifies Aspire resource injection vs provider ownership for journaling sample. |
| docs/site/src/content/docs/toc.yml | Adds DynamoDB-with-Aspire doc to TOC. |
| docs/site/src/content/docs/streaming/stream-providers.md | Updates provider overview with Aspire guidance for Event Hubs and NATS. |
| docs/site/src/content/docs/streaming/kinesis-streaming.md | Adds Aspire configuration guidance and snippets for Kinesis streaming and checkpointing. |
| docs/site/src/content/docs/snippets/compiled/Streaming/KinesisSnippets.cs | Adds compiled snippets for Aspire Kinesis silo/client setup. |
| docs/site/src/content/docs/host/snippets/aspire/Silo/SiloProgram.cs | Adds silo-side snippets for keyed client registration across providers. |
| docs/site/src/content/docs/host/snippets/aspire/Silo/Silo.csproj | Updates snippet project package references for added Aspire/provider examples. |
| docs/site/src/content/docs/host/snippets/aspire/AppHost/AppHostExamples.cs | Expands AppHost examples for Azure/Cosmos/Redis/AWS DynamoDB/Kinesis and ADO.NET databases. |
| docs/site/src/content/docs/host/snippets/aspire/AppHost/AppHost.csproj | Updates AppHost snippet project dependencies for new examples. |
| docs/site/src/content/docs/host/dynamodb-aspire.md | Adds a dedicated DynamoDB + Aspire guide (local + structured outputs + credential guidance). |
| docs/site/src/content/docs/host/configuration-guide/configuring-ado-dot-net-providers.md | Adds Aspire configuration guidance and mapping table for ADO.NET providers. |
| docs/site/src/content/docs/host/aspire-integration.md | Updates Aspire integration guidance, provider wiring table, and journaling configuration shape. |
| docs/site/src/content/docs/grains/reminders/dynamodb.md | Links DynamoDB reminders doc to new DynamoDB-with-Aspire guidance. |
| docs/site/src/content/docs/grains/journaling/redis-journal-storage.md | Adds Aspire usage guidance for Redis journaling. |
| docs/site/src/content/docs/grains/journaling/azure-storage.md | Adds Aspire usage guidance for Azure Storage journaling. |
| docs/site/src/content/docs/grains/grain-persistence/redis-storage.md | Adds Aspire usage guidance for Redis persistence and provider aliases. |
| docs/site/src/content/docs/grains/grain-persistence/dynamodb-storage.md | Links DynamoDB persistence doc to new DynamoDB-with-Aspire guidance. |
| docs/site/src/content/docs/grains/grain-persistence/azure-storage.md | Adds Aspire usage guidance for Azure Storage persistence/streaming. |
| docs/site/src/content/docs/grains/grain-persistence/azure-cosmos-db.md | Adds Aspire usage guidance for Cosmos DB provider provisioning + keyed client registration. |
| Directory.Packages.props | Adds/updates Aspire-related package versions used by new tests/docs. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 75/75 changed files
- Comments generated: 3
- Review effort level: Lite
There was a problem hiding this comment.
Review details
Suppressed comments (1)
test/Extensions/Orleans.Streaming.Kinesis.Tests/KinesisAspireIntegrationTests.cs:208
- This test is named as if it exercises the client hosting path, but it currently builds a silo host (
UseOrleans). That means it doesn't validate that the client-side provider builder is wired up correctly (and the test name is misleading).
- Files reviewed: 79/79 changed files
- Comments generated: 1
- Review effort level: Lite
There was a problem hiding this comment.
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
src/Orleans.Streaming.NATS/Providers/NatsConnectionManager.cs:46
- When a keyed/shared INatsConnection is provided, _natsServer is set to the literal string "the keyed NATS connection". This value is used in connection/JetStream log messages, which makes troubleshooting harder than necessary because the actual server URL is available on the shared connection options.
test/Extensions/Orleans.Streaming.Kinesis.Tests/KinesisAspireIntegrationTests.cs:205
- This test method name says it is validating client configuration, but it builds a silo host via BuildSiloHost and resolves silo-registered options. Either rename the test to reflect that it's exercising the silo path, or add a client-host builder and assert the client configuration path explicitly.
- Files reviewed: 80/80 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
The current AWS failures are PR-specific:
Failed run: https://github.com/dotnet/orleans/actions/runs/32643239886 The Kinesis configuration precedence and DynamoDB test/table lifecycle need correction before retrying these jobs. |
|
The new head Failed run: https://github.com/dotnet/orleans/actions/runs/32644764656 The AWS dependency graph/version selection needs to stay within packages available through the repository's mapped feeds so |
Code coverage
Report-only conclusion: improved. The current-main baseline is commit Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
There was a problem hiding this comment.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
src/Azure/Orleans.Reminders.Cosmos/CosmosRemindersProviderBuilder.cs:27
- When
ServiceKeyis set, the code usesGetRequiredKeyedService<CosmosClient>(serviceKey), which will throw a genericInvalidOperationExceptionif the keyed client is missing. That exception won’t include the Orleans configuration path (configurationSection.Path) or actionable guidance, making misconfiguration harder to diagnose.
src/AdoNet/Orleans.Streaming.AdoNet/Hosting/AdoNetStreamingProviderBuilder.cs:81 PartitionCountis applied as-is when it parses as anint, including 0 or negative values. That can result in an invalidHashRingStreamQueueMapperOptions.TotalQueueCount(and downstream failures) without an actionable configuration error.
- Files reviewed: 83/83 changed files
- Comments generated: 0 new
- Review effort level: Lite
a0de56e to
b3c56d3
Compare
b3c56d3 to
2deee6b
Compare
Move independent NATS producer selection and dimension validation to dotnet#11287 and dotnet#11293. Move standalone redaction, credential, and journaling regression coverage to dotnet#11288, dotnet#11289, dotnet#11291, and dotnet#11292; move the independent DynamoDB README recipes to dotnet#11292. Retain Token redaction, credential binding and endpoint behavior, journaling activation, and NATS credential-safe logging as prerequisites until dotnet#11288, dotnet#11290, dotnet#11292, dotnet#11289, and dotnet#11291 are merged by humans. The original PR remains focused on Aspire configuration, resource ownership, and integration coverage.
Reject missing named DynamoDB connections and conflicting ADO.NET references. Preserve provider-local connection strings ahead of referenced AWS outputs while retaining named-connection and structured-output semantics.
Keep the guards from merged dotnet#11293 when replaying the original PR's pre-merge extraction cleanup.
Carry the finalized Journaling subsection and internal builder naming from dotnet#11289 while preserving Default and named bindings, Aspire aliases, and the standalone core-test boundary. Original-commit: febff2c
Match host IConfiguration registration when running merged credential-binding regressions against the resource-aware provider builders.
Use development credentials for HTTP Kinesis and DynamoDB checkpoint container endpoints while preserving explicit keys, profiles, default AWS credentials, and existing checkpoint loopback behavior. Verify actual SDK signing through an offline HTTP handler.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved DynamoDB structured-resource fallback and Kinesis endpoint handling require changes.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 6
Open (8)
Use emulator credentials for non-loopback DynamoDB checkpoints Use emulator credentials for non-loopback Kinesis endpoints Exclude testing-only Kinesis integration from net8 Regenerate DynamoDB API surfaces for the redaction attribute Fix the docs snippet repository root path Fix the docs snippet repository root path Include the section path in invalid enum errors · New Add live coverage for Aspire ADO.NET configuration · New
| throw new OrleansConfigurationException( | ||
| $"NATS stream provider setting '{key}' has invalid value '{value}'."); |
| public async Task GeneratedConfiguration_ActivatesAllSupportedCapabilities( | ||
| AdoNetAspireDatabase databaseType, | ||
| string expectedProviderType, | ||
| string expectedInvariant) |


Problem
Orleans Aspire support was uneven across first-party provider integrations: several providers lacked configuration-driven builders, AppHost activation coverage, live-provider coverage, or a current provider matrix describing resource ownership and configuration flow.
Solution
Aspire.Hosting.AWSand AWS CDK, using shared resource identities and CDK-owned lifecycle settingsOrleans:Journaling:{name}entries and explicit Aspire resource references;Defaultselects the default journal bindingMerged standalone extractions
All seven independently reviewable extractions have been merged by humans and are inherited from
main:Journalingprovider activation, registration kinds, and internal builder namingThis branch is rebased onto
mainatad71848f84. Redundant prerequisite implementations and standalone regressions have been removed from its diff. The remaining journaling changes cover Aspire's Azure Redis aliases, named resource emissions, and actual default/archive backend bindings. Existing public package and API names are preserved.The two Kinesis container-credential findings are addressed at SDK client creation. Offline request-signing regressions exercise both factories and the configuration-driven path, including explicit keys, session credentials, named profiles, HTTP hostnames, HTTPS/region credential-chain behavior, and the checkpoint factory's existing loopback policy.
Remaining dependency
#10797: Aspire SQS integration, referenced by the provider matrix and examples. The extracted fixes above are no longer pending prerequisites.
Rationale
A shared configuration contract lets Aspire provision and describe resources while Orleans providers retain ownership of runtime behavior, topology, persistence, and recovery. Separating generally applicable fixes makes those changes reviewable independently while keeping this PR focused on integration, resource ownership, configuration validation, and provider behavior.
Fixes #10784
Microsoft Reviewers: Open in CodeFlow