Language

AddBotApplicationExtensions.EnsureMsalServices Method

Definition

Registers the shared MSAL token-acquisition pipeline and binds the named MSAL options.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection EnsureMsalServices(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Teams.Core.Hosting.BotConfig botConfig);
static member EnsureMsalServices : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Teams.Core.Hosting.BotConfig -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function EnsureMsalServices (services As IServiceCollection, botConfig As BotConfig) As IServiceCollection

Parameters

botConfig
BotConfig

Returns

Remarks

Safe to call multiple times: the Microsoft.Identity.Web service registrations are TryAdd-based, and the named options binding (MicrosoftIdentityApplicationOptions and ManagedIdentityOptions) appends an additional configure delegate per call. Those delegates are idempotent against the same BotConfig, so re-running them produces the same options state.

Applies to