Do we have support to have CosmosClient included in AddAzureClients
See original GitHub issueIs the CosmosClient
supported here https://devblogs.microsoft.com/azure-sdk/best-practices-for-using-azure-sdk-with-asp-net-core/
This extension is usefull and neat, it would work like this for Blob Storage
builder.Services.AddAzureClients(options =>
{
//Add storage accounts
options.AddBlobServiceClient(i"blabla").;
// Use DefaultAzureCredential by default
options.UseCredential(new DefaultAzureCredential());
});
I wonder if we can add AddCosmosServiceClient
?
I did not find it in the docs.
Issue Analytics
- State:
- Created 2 months ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Dependency injection with the Azure SDK for .NET
Learn how to use dependency injection with the Azure SDK for .NET client libraries.
Read more >How to add CosmosDB to .Net 6 WebAPI?
In .Net 6.0, you should add `CosmosClient` in your `Program.cs` file like below sample code. using Microsoft.Azure.Cosmos; using Microsoft.
Read more >Azure Cosmos DB SQL API client library for Python
Use the Azure Cosmos DB SQL API SDK for Python to manage databases and the JSON documents they contain in this NoSQL database...
Read more >Azure client library integration for ASP.NET Core
Make a call to AddAzureClients in your app's ConfigureServices method. You can use the provided builder to register client instances with your dependency ......
Read more >Keyless Connections to Azure Cosmos DB (RBAC auth for data)
The best way to prevent leaking secrets is to not have any in the first ... app does not need access to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jsquire Thanks for the explanation. @Ponant Right now, these extension methods are not available in cosmosdb SDK. We are adding it in our backlog items. Will cover it in near future.
@kirankumarkolli: Not at all, you’re welcome to use them. There are no gates, just the ability to extend the Azure.Core interfaces, which should be available to v3 of the Cosmos package due to the existing dependency. Developers referencing
Microsoft.Extensions.Azure
and the Cosmos client library would see the extensions and have access to the shortcut for registering Cosmos clients with DI. Developers not using the Cosmos package would not see those extensions.There are some assumptions about patterns - such as using TokenCredential for auth - but you have control over which extensions you make and can either work around them or choose to not include that overload.