AzureCredentialResolver Class

Definition

A CredentialResolver that produces Azure credentials (TokenCredential instances) from an IConfigurationSection. It dispatches on the CredentialSource value of the supplied section and recognizes the full set of Azure token-based credential sources (e.g. AzureCliCredential, ManagedIdentityCredential, EnvironmentCredential, WorkloadIdentityCredential, ChainedTokenCredential, etc.). API-key sections (CredentialSource: ApiKeyCredential) are intentionally NOT claimed by this resolver β€” consuming clients that accept an API key are expected to dispatch on Credential.CredentialSource themselves at construction time and read Credential.Key directly.

public sealed class AzureCredentialResolver : System.ClientModel.Primitives.CredentialResolver
type AzureCredentialResolver = class
    inherit CredentialResolver
Public NotInheritable Class AzureCredentialResolver
Inherits CredentialResolver
Inheritance
AzureCredentialResolver

Remarks

Register this resolver explicitly via AddAzureCredentialResolver(IServiceCollection) (or its host-builder overload), or rely on GetAzureCredentialSettings(IConfiguration, String) and friends, which transparently append a built-in instance to the resolver chain. The class has a public parameterless constructor so it can be used with AddCredentialResolver<AzureCredentialResolver>().

Constructors

Name Description
AzureCredentialResolver()

Initializes a new instance of AzureCredentialResolver.

Methods

Name Description
TryResolve(IConfigurationSection, AuthenticationTokenProvider)

Attempts to construct an AuthenticationTokenProvider for the supplied credential configuration section.

Applies to