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.

[FEATURE REQ] Support for CosmosClient in AddAzureClients

See original GitHub issue

Library name

Microsoft.Extensions.Azure

Please describe the feature.

Coming from https://github.com/Azure/azure-cosmos-dotnet-v3/issues/4002, I have been sent here.

The following extension is useful 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 something like AddCosmosServiceClient? I did not find it in the docs.

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Ponantcommented, Jul 24, 2023

Thanks @jsquire 💯

1reaction
jsquirecommented, Jul 24, 2023

Hi @Ponant. This extension would need to be defined in the Cosmos package where the client is defined. Unfortunately, as that means in the Cosmos repository where the original issue was opened. I’ve responded to that issue directly to let the Cosmos team know.

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
Interaction with Cosmos DB starts with an instance of the CosmosClient class. You need an account, its URI, and one of its account...
Read more >
Working with CosmosClient in Azure Functions
In this article, you will learn how you can use the new CosmosClient within your Azure Functions to leverage the Azure Cosmos DB...
Read more >
Using Managed Identities to authenticate with Azure Cosmos DB
We can use this identity to authenticate with any service in Azure that supports Azure AD authentication without having to manage credentials.
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