Skip to content

[FEATURE REQ] Support keyed DI with AddAzureClients #40408

@Arithmomaniac

Description

@Arithmomaniac

Library name

Microsoft.Extensions.Azure

Please describe the feature.

When registering multiple services by name (using WithName()) with .AddAzureClients, you need to resolve the intended service via DI by injecting an IAzureClientFactory<TClient> so that you can invoke .CreateClient() on the named service.

It would be great if registering a dependency by name would register the client with the new keyed DI support so that instances of TClient can be injected directly. Or if that poses compatibility issues, add a new WithKey() method to do the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageExtensionsASP.NET Core extensionscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions