ConfigurationExtensions.GetAzureCredentialSettings Method

Definition

Overloads

Name Description
GetAzureCredentialSettings(IConfiguration, String)

Returns the CredentialSettings bound from the named credential section, with TokenProvider populated by the built-in AzureCredentialResolver when it claims the section.

GetAzureCredentialSettings(IConfiguration, String, CredentialResolver[])

Returns the CredentialSettings bound from the named credential section. Caller-supplied resolvers are evaluated in order; the built-in AzureCredentialResolver is appended to the chain as a fallback. The first resolver to claim the section populates TokenProvider.

GetAzureCredentialSettings(IConfiguration, String, IEnumerable<CredentialResolver>, Action<IConfigurationSection>)

Returns the CredentialSettings bound from the named credential section, applying configureOverrides to the credential section before resolving. Caller-supplied resolvers are evaluated in order; the built-in AzureCredentialResolver is appended to the chain as a fallback.

GetAzureCredentialSettings(IConfiguration, String)

Source:
ConfigurationExtensions.cs

Returns the CredentialSettings bound from the named credential section, with TokenProvider populated by the built-in AzureCredentialResolver when it claims the section.

public static System.ClientModel.Primitives.CredentialSettings GetAzureCredentialSettings(this Microsoft.Extensions.Configuration.IConfiguration configuration, string sectionName);
static member GetAzureCredentialSettings : Microsoft.Extensions.Configuration.IConfiguration * string -> System.ClientModel.Primitives.CredentialSettings
<Extension()>
Public Function GetAzureCredentialSettings (configuration As IConfiguration, sectionName As String) As CredentialSettings

Parameters

configuration
IConfiguration

The configuration to resolve from.

sectionName
String

The credential section name (treated as the credential section itself, not a parent client section).

Returns

Remarks

For token-credential sections the returned settings' TokenProvider is a TokenCredential. For inline ApiKey sections Key is populated and TokenProvider is null, letting callers dispatch on either shape without binding a ClientSettings. Returns null only when the named section does not exist. Never throws.

Applies to

GetAzureCredentialSettings(IConfiguration, String, CredentialResolver[])

Source:
ConfigurationExtensions.cs

Returns the CredentialSettings bound from the named credential section. Caller-supplied resolvers are evaluated in order; the built-in AzureCredentialResolver is appended to the chain as a fallback. The first resolver to claim the section populates TokenProvider.

public static System.ClientModel.Primitives.CredentialSettings GetAzureCredentialSettings(this Microsoft.Extensions.Configuration.IConfiguration configuration, string sectionName, params System.ClientModel.Primitives.CredentialResolver[] resolvers);
static member GetAzureCredentialSettings : Microsoft.Extensions.Configuration.IConfiguration * string * System.ClientModel.Primitives.CredentialResolver[] -> System.ClientModel.Primitives.CredentialSettings
<Extension()>
Public Function GetAzureCredentialSettings (configuration As IConfiguration, sectionName As String, ParamArray resolvers As CredentialResolver()) As CredentialSettings

Parameters

configuration
IConfiguration

The configuration to resolve from.

sectionName
String

The credential section name.

resolvers
CredentialResolver[]

Caller-supplied resolvers evaluated before the built-in resolver.

Returns

Remarks

When no resolver claims the section (for example, an inline ApiKey section, where the Azure resolver intentionally defers), the returned settings still expose the bound Key, CredentialSource, and AdditionalProperties. Returns null only when the named section does not exist. Never throws.

Applies to

GetAzureCredentialSettings(IConfiguration, String, IEnumerable<CredentialResolver>, Action<IConfigurationSection>)

Source:
ConfigurationExtensions.cs

Returns the CredentialSettings bound from the named credential section, applying configureOverrides to the credential section before resolving. Caller-supplied resolvers are evaluated in order; the built-in AzureCredentialResolver is appended to the chain as a fallback.

public static System.ClientModel.Primitives.CredentialSettings GetAzureCredentialSettings(this Microsoft.Extensions.Configuration.IConfiguration configuration, string sectionName, System.Collections.Generic.IEnumerable<System.ClientModel.Primitives.CredentialResolver> resolvers, Action<Microsoft.Extensions.Configuration.IConfigurationSection> configureOverrides);
static member GetAzureCredentialSettings : Microsoft.Extensions.Configuration.IConfiguration * string * seq<System.ClientModel.Primitives.CredentialResolver> * Action<Microsoft.Extensions.Configuration.IConfigurationSection> -> System.ClientModel.Primitives.CredentialSettings
<Extension()>
Public Function GetAzureCredentialSettings (configuration As IConfiguration, sectionName As String, resolvers As IEnumerable(Of CredentialResolver), configureOverrides As Action(Of IConfigurationSection)) As CredentialSettings

Parameters

configuration
IConfiguration
sectionName
String
configureOverrides
Action<IConfigurationSection>

Returns

Remarks

The returned settings reflect the post-overlay merged view for Key, CredentialSource, AdditionalProperties, and the Item[String] indexer. Returns null only when the named section does not exist. Never throws.

Applies to