AspireAppConfigurationExtensions Methods
ClassMethods1 member
Provides extension methods for registering and configuring Azure App Configuration in an Aspire application.
AddAzureAppConfiguration(IHostApplicationBuilder, string, Action<AzureAppConfigurationSettings>, Action<AzureAppConfigurationOptions>) Section titled AddAzureAppConfiguration(IHostApplicationBuilder, string, Action<AzureAppConfigurationSettings>, Action<AzureAppConfigurationOptions>)extension Adds the Azure App Configuration to be configuration in the
builder. public static class AspireAppConfigurationExtensions{ public static void AddAzureAppConfiguration( this IHostApplicationBuilder builder, string connectionName, Action<AzureAppConfigurationSettings>? configureSettings = null, Action<AzureAppConfigurationOptions>? configureOptions = null) { // ... }}Parameters
builderIHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to.connectionName stringA name used to retrieve the connection string from the ConnectionStrings configuration section.configureSettings Action<AzureAppConfigurationSettings> optionalAn optional method that can be used for customizing the AzureAppConfigurationSettings . It's invoked after the settings are read from the configuration.configureOptions Action<AzureAppConfigurationOptions> optionalAn optional method that can be used for customizing the AzureAppConfiguration.AzureAppConfigurationOptions .Exceptions
InvalidOperationExceptionThrown when mandatory AzureAppConfigurationSettings.Endpoint is not provided.Remarks
Reads the settings from "Aspire:Microsoft:Extensions:Configuration:AzureAppConfiguration" section.