Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration
13.0.2
Prefix Reserved
dotnet add package Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration --version 13.0.2
NuGet\Install-Package Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration -Version 13.0.2
<PackageReference Include="Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="13.0.2" />
<PackageVersion Include="Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="13.0.2" />
<PackageReference Include="Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration" />
paket add Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration --version 13.0.2
#r "nuget: Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration, 13.0.2"
#:package Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration@13.0.2
#addin nuget:?package=Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration&version=13.0.2
#tool nuget:?package=Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration&version=13.0.2
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration
Retrieves configuration settings from Azure App Configuration to use in your application. Registers Azure App Configuration service as a configuration source. Enables corresponding logging and telemetry.
Getting started
Prerequisites
- Azure subscription - create one for free
- Azure App Configuration - create one.
Install the package
Install the Aspire Azure App Configuration library with NuGet:
dotnet add package Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration
Usage examples
Add App Configuration to configuration
In the Program.cs file of your project, call the builder.Configuration.AddAzureAppConfiguration extension method to add key-values from Azure App Configuration to the application's Configuration. The method takes a connection name parameter.
builder.AddAzureAppConfiguration("appConfig");
You can then retrieve a key-value through normal IConfiguration APIS. For example, to retrieve a key-value from a Web API controller:
public MyController(IConfiguration configuration)
{
string someValue = configuration["someKey"];
}
Use feature flags
To use feature flags, install the Feature Management library:
dotnet add package Microsoft.FeatureManagement
App Configuration will not load feature flags by default. To load feature flags, you can pass the Action<AzureAppConfigurationOptions> configureOptions delegate when calling builder.AddAzureAppConfiguration.
builder.AddAzureAppConfiguration(
"appConfig",
configureOptions: options => options.UseFeatureFlags());
// Register feature management services
builder.Services.AddFeatureManagement();
You can then use IVariantFeatureManager to evaluate feature flags in your application:
private readonly IVariantFeatureManager _featureManager;
public MyController(IVariantFeatureManager featureManager)
{
_featureManager = featureManager;
}
[HttpGet]
public async Task<IActionResult> Get()
{
if (await _featureManager.IsEnabledAsync("NewFeature"))
{
return Ok("New feature is enabled!");
}
return Ok("Using standard implementation.");
}
For information about using the Feature Management library, please go to the documentation.
Configuration
The Aspire Azure App Configuration library provides multiple options to configure the Azure App Configuration connection based on the requirements and conventions of your project. Note that the App Config endpoint is required to be supplied, either in AzureAppConfigurationSettings.Endpoint or using a connection string.
Use a connection string
When using a connection string from the ConnectionStrings configuration section, you can provide the name of the connection string when calling builder.AddAzureAppConfiguration():
builder.AddAzureAppConfiguration("appConfigConnectionName");
And then the App Configuration endpoint will be retrieved from the ConnectionStrings configuration section. The App Configuration store URI works with the AzureAppConfigurationSettings.Credential property to establish a connection. If no credential is configured, the DefaultAzureCredential is used.
{
"ConnectionStrings": {
"appConfigConnectionName": "https://{store_name}.azconfig.io"
}
}
Use configuration providers
The Aspire Azure App Configuration library supports Microsoft.Extensions.Configuration. It loads the AzureAppConfigurationSettings from configuration by using the Aspire:Microsoft:Extensions:Configuration:AzureAppConfiguration key. Example appsettings.json that configures some of the options:
{
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration
"Aspire": {
"Microsoft": {
"Extensions": {
"Configuration": {
"AzureAppConfiguration": {
"Endpoint": "YOUR_APPCONFIGURATION_ENDPOINT_URI"
}
}
}
}
}
}
Use inline delegates
You can also pass the Action<AzureAppConfigurationSettings> configureSettings delegate to set up some or all the options inline, for example to set App Configuration endpoint from code:
builder.AddAzureAppConfiguration("appConfig", configureSettings: settings => settings.Endpoint = "http://YOUR_URI");
AppHost extensions
In your AppHost project, install the Aspire Azure App Configuration Hosting library with NuGet:
dotnet add package Aspire.Hosting.Azure.AppConfiguration
Then, in the Program.cs file of AppHost, add a App Configuration connection and consume the connection using the following methods:
// Service registration
var appConfig = builder.AddAzureAppConfiguration("appConfig");
// Service consumption
var myService = builder.AddProject<Projects.MyService>()
.WithReference(appConfig);
The AddAzureAppConfiguration method adds an Azure App Configuration resource to the builder. Or AddConnectionString can be used to read connection information from the AppHost's configuration under the ConnectionStrings:appConfig config key. The WithReference method passes that connection information into a connection string named appConfig in the MyService project. In the Program.cs file of MyService, the connection can be consumed using:
builder.AddAzureAppConfiguration("appConfig");
Additional documentation
- https://learn.microsoft.com/azure/azure-app-configuration/
- https://github.com/dotnet/aspire/tree/main/src/Components/README.md
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Core (>= 1.49.0)
- Azure.Identity (>= 1.17.0)
- Azure.Security.KeyVault.Secrets (>= 4.8.0)
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Azure (>= 1.13.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Configuration.AzureAppConfiguration (>= 8.4.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Microsoft.Extensions.Primitives (>= 10.0.0)
- OpenTelemetry.Extensions.Hosting (>= 1.9.0)
-
net8.0
- Azure.Core (>= 1.49.0)
- Azure.Identity (>= 1.17.0)
- Azure.Security.KeyVault.Secrets (>= 4.8.0)
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Azure (>= 1.13.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.AzureAppConfiguration (>= 8.4.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.22)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Primitives (>= 8.0.0)
- OpenTelemetry.Extensions.Hosting (>= 1.9.0)
-
net9.0
- Azure.Core (>= 1.49.0)
- Azure.Identity (>= 1.17.0)
- Azure.Security.KeyVault.Secrets (>= 4.8.0)
- DnsClient (>= 1.8.0)
- Microsoft.Extensions.Azure (>= 1.13.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.11)
- Microsoft.Extensions.Configuration.AzureAppConfiguration (>= 8.4.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.11)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.11)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.11)
- Microsoft.Extensions.Options (>= 9.0.11)
- Microsoft.Extensions.Primitives (>= 9.0.11)
- OpenTelemetry.Extensions.Hosting (>= 1.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.0.2 | 352 | 12/4/2025 |
| 13.0.1 | 1,478 | 11/26/2025 |
| 13.0.0 | 8,996 | 11/11/2025 |
| 9.5.2-preview.1.25522.3 | 3,379 | 10/23/2025 |
| 9.5.1-preview.1.25502.11 | 4,700 | 10/3/2025 |
| 9.5.0-preview.1.25474.7 | 1,192 | 9/25/2025 |
| 9.4.2-preview.1.25428.12 | 2,344 | 9/2/2025 |
| 9.4.1-preview.1.25408.4 | 749 | 8/12/2025 |
| 9.4.0-preview.1.25378.8 | 5,739 | 7/29/2025 |
| 9.3.1-preview.1.25305.6 | 5,839 | 6/10/2025 |
| 9.3.0-preview.1.25265.20 | 6,333 | 5/19/2025 |