question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do we have support to have CosmosClient included in AddAzureClients

See original GitHub issue

Is 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:open
  • Created 2 months ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sourabh1007commented, Jul 25, 2023

@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.

1reaction
jsquirecommented, Jul 25, 2023

@jsquire do above extensions gate on Track2 libraries (ex: Azure.* namespace) only?

CosmosDB Test2 is not yet available.

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found