AspireAppConfigurationExtensions Methods
Class Methods 1 member
Provides extension methods for registering and configuring Azure App Configuration in a .NET 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
builder IHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to. connectionName string A name used to retrieve the connection string from the ConnectionStrings configuration section. configureSettings Action<AzureAppConfigurationSettings> optional An optional method that can be used for customizing the AzureAppConfigurationSettings. It's invoked after the settings are read from the configuration. configureOptions Action<AzureAppConfigurationOptions> optional An optional method that can be used for customizing the AzureAppConfiguration.AzureAppConfigurationOptions. Exceptions
InvalidOperationException Thrown when mandatory AzureAppConfigurationSettings.Endpoint is not provided. Remarks
Reads the settings from "Aspire:Microsoft:Extensions:Configuration:AzureAppConfiguration" section.