Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import appConfigIcon from '@assets/icons/azure-appconfig-icon.png';
alt="Azure App Configuration logo"
height={80}
width={80}
class:list={'float-inline-left icon'}
class:list={"float-inline-left icon"}
data-zoom-off
/>

Expand Down Expand Up @@ -242,7 +242,7 @@ var appConfig = builder.AddAzureAppConfiguration("config")

##### Configure Azure App Configuration emulator with data volume

To add a data volume to the Azure App Configuration emulator resource, call the `WithDataVolume` method on the emulator resource:
By default, the Azure App Configuration emulator doesn't persist data between container restarts. To enable persistent storage using a Docker volume, call the `WithDataVolume` method on the emulator resource:

```csharp
var builder = DistributedApplication.CreateBuilder(args);
Expand All @@ -256,11 +256,11 @@ var appConfig = builder.AddAzureAppConfiguration("config")
// After adding all resources, run the app...
```

The data volume is used to persist the emulator data outside the lifecycle of its container. The data volume is mounted at the `/data` path in the emulator container and when a `name` parameter isn't provided, the name is autogenerated from the application and resource names (for example, if your application is named `myapp` and the resource is `config`, the autogenerated name will be `myapp-config`). For more information on data volumes and details on why they're preferred over [bind mounts](#configure-azure-app-configuration-emulator-with-data-bind-mount), see [Docker docs: Volumes](https://docs.docker.com/engine/storage/volumes).
The data volume is used to persist the emulator data outside the lifecycle of its container, ensuring configuration values survive container restarts. The data volume is mounted at the `/data` path in the emulator container and when a `name` parameter isn't provided, the name is autogenerated from the application and resource names (for example, if your application is named `myapp` and the resource is `config`, the autogenerated name will be `myapp-config`). For more information on data volumes and details on why they're preferred over [bind mounts](#configure-azure-app-configuration-emulator-with-data-bind-mount), see [Docker docs: Volumes](https://docs.docker.com/engine/storage/volumes).

##### Configure Azure App Configuration emulator with data bind mount

To add a data bind mount to the Azure App Configuration emulator resource, call the `WithDataBindMount` method:
To persist emulator data to a specific directory on your host machine, call the `WithDataBindMount` method. This is useful when you want direct access to the data files on your host system:

```csharp title="C# — AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
Expand Down Expand Up @@ -303,13 +303,37 @@ public class ExampleService(IConfiguration configuration)
}
```

### Configure the Azure App Configuration provider

The `AddAzureAppConfiguration` method accepts an optional `Action<AzureAppConfigurationOptions> configureOptions` delegate that you use to configure the Azure App Configuration provider. This follows the same pattern as the non-Aspire `Microsoft.Extensions.Configuration.AzureAppConfiguration` package, but Aspire automatically handles the connection—you don't need to call `options.Connect`.

```csharp title="C# — Program.cs"
builder.AddAzureAppConfiguration(
"config",
configureOptions: options =>
{
// Select specific keys or labels
options.Select("MyApp:*");
options.Select("MyApp:*", "Production");

// Configure refresh options
options.ConfigureRefresh(refresh =>
{
refresh.Register("MyApp:Sentinel", refreshAll: true)
.SetRefreshInterval(TimeSpan.FromSeconds(30));
});
});
```

For more information on available configuration options, see the [Azure App Configuration provider reference](https://learn.microsoft.com/azure/azure-app-configuration/reference-dotnet-provider).

### Use feature flags

To use feature flags, install the [📦 Microsoft.FeatureManagement](https://www.nuget.org/packages/Microsoft.FeatureManagement) NuGet package:

<InstallDotNetPackage packageName="Microsoft.FeatureManagement" />

App Configuration doesn't load feature flags by default. To load feature flags, you pass the `Action<AzureAppConfigurationOptions> configureOptions` delegate when calling `builder.AddAzureAppConfiguration`.
App Configuration doesn't load feature flags by default. To load feature flags, use the `configureOptions` delegate (as shown in [Configure the Azure App Configuration provider](#configure-the-azure-app-configuration-provider)) to call `UseFeatureFlags()` when calling `builder.AddAzureAppConfiguration`.

```csharp title="C# — Program.cs"
builder.AddAzureAppConfiguration(
Expand Down