CosmosDb IStorage for the Microsoft Agents SDK
$ dotnet add package Microsoft.Agents.Storage.CosmosDb| Version | Date | Changelog |
|---|---|---|
| 1.2.0 | 2025-08-19 | Detailed Changelog |
| 1.3.0 | 2025-10-22 | Detailed Changelog |
{
"CosmosDbPartitionedStorageOptions": {
"CosmosDbEndpoint": "{db_endpoint}",
"DatabaseId": "{db_id}",
"ContainerId": "{container_id}"
}
}
builder.Services.AddSingleton<IStorage>((sp) => new CosmosDbPartitionedStorage(
builder.Configuration.GetSection(nameof(CosmosDbPartitionedStorageOptions))
.Get<CosmosDbPartitionedStorageOptions>()));
CosmosDbPartitionedStorageOptions.AuthKey or CosmosDbPartitionedStorageOptions.TokenCredential should be defined.