Skip to content

Commit

Permalink
Fix typo in CosmosDB README (#2177)
Browse files Browse the repository at this point in the history
  • Loading branch information
joegoldman2 authored Mar 30, 2024
1 parent 8d0f9b3 commit e8702a2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/HealthChecks.CosmosDb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void Configure(IHealthChecksBuilder builder)
ApplicationRegion = Regions.EastUS2,
}));
builder.AddHealthChecks().AddAzureCosmosDB(
optionsFactory: sp => new CosmosDbHealthCheckOptions()
optionsFactory: sp => new AzureCosmosDbHealthCheckOptions()
{
DatabaseId = "demo"
});
Expand All @@ -48,5 +48,3 @@ void Configure(IHealthChecksBuilder builder)
### Breaking changes

In the prior releases, `CosmosDbHealthCheck` was a part of `HealthChecks.CosmosDb` package. It had a dependency on not just `Microsoft.Azure.Cosmos`, but also `Azure.Data.Tables`. The packages have been split to avoid bringing unnecessary dependencies. Moreover, `CosmosDbHealthCheck` was letting the users specify how `CosmosClient` should be created (from raw connection string or from endpoint and managed identity credentials), at a cost of maintaining an internal, static client instances cache. Now the type does not create client instances nor maintain an internal cache and **it's the caller responsibility to provide the instance of `CosmosClient`** (please see [#2040](https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/2040) for more details). Since Azure SDK recommends treating clients as singletons <see href="https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/"/> and client instances can be expensive to create, it's recommended to register a singleton factory method for Azure SDK clients. So the clients are created only when needed and once per whole application lifetime.


0 comments on commit e8702a2

Please sign in to comment.