feat(cosmos): add configuration support for grain storage

Merged
RE
2mo ago
+125-0

Follow-up to #8699.

Adds IConfiguration support for Cosmos grain storage and addresses the document ID provider configuration feedback.

  • Registers AzureCosmosDB as a GrainStorage provider.
  • Binds CosmosGrainStorageOptions from the provider configuration section.
  • Supports ServiceKey, ConnectionName, and ConnectionString for the Cosmos client.
  • Supports DocumentIdProviderKey, resolving an application-registered keyed IDocumentIdProvider through dependency injection and aliasing it to the storage provider name.
  • Keeps service selection out of CosmosGrainStorageOptions and avoids reflection/type-name activation.

Tests cover keyed provider resolution, constructor dependency injection, and named options binding on net8.0 and net10.0.

Microsoft Reviewers: Open in CodeFlow