Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.56k stars 4.82k forks source link

[FEATURE REQ] AddClient support using the configuration to create a client instance #47160

Open scrocquesel-ml150 opened 1 week ago

scrocquesel-ml150 commented 1 week ago

Library name

Microsoft.Extensions.Azure

Please describe the feature.

I want to be able to register client using a configuration object to create a client instance.

The Azure.IoT.DeviceUpdate do not have support for dependency injection with a dedicated extension method (see https://github.com/Azure/azure-sdk-for-net/issues/43099). Meanwhile, I would like to register it myself with configuration object.

serviceCollection.AddAzureClients(clientBuilder =>
        {
            clientBuilder.AddClient<DeviceUpdateClient, DeviceUpdateClientOptions>(configuration.GetSection("DUConnection"));
        });

Should do the same thing as other client extension, for example

    clientBuilder.AddEventHubProducerClient(configuration.GetSection("EventHubConnection"));
github-actions[bot] commented 1 week ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jsquire commented 1 week ago

Hi @scrocquesel-ml150. Thanks for reaching out and for your suggestion. Integrating with configuration is an area that we're currently investigating for the Azure SDK for .NET packages. We'll consider this request as part of that discovery.

jsquire commented 1 week ago

//fyi: @annelo-msft