Skip to content

Add Azure App Configuration client integration #8459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

zhiyuanliang-ms
Copy link
Contributor

@zhiyuanliang-ms zhiyuanliang-ms commented Apr 1, 2025

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #787

Checklist

  • Is this feature complete?
    • [x ] Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • [ x] Yes
    • No
  • Did you add public API?
    • [ x] Yes
      • If yes, did you have an API Review for it?
        • [ x] Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • [ x] Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • [ x] No
  • Does the change require an update in our Aspire docs?

@Copilot Copilot AI review requested due to automatic review settings April 1, 2025 06:19
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Apr 1, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds Azure App Configuration support to the Aspire framework by introducing a new component for managing connection settings, health checks, client registrations, and related extension methods.

  • Adds configuration settings, health check, and component classes for Azure App Configuration.
  • Provides extension methods for both keyed and unkeyed client registration.
  • Updates playground projects to demonstrate usage.

Reviewed Changes

Copilot reviewed 17 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
AzureDataAppConfigurationSettings.cs Introduces settings class implementing connection string parsing.
AzureAppConfigurationHealthCheck.cs Implements a health check for the ConfigurationClient.
AssemblyInfo.cs Registers configuration schemas and logging categories.
AspireAppConfigurationExtensions.cs Provides extension methods to register and configure the Azure App Configuration client.
AppConfigurationComponent.cs Implements the Azure component for client creation, health checks, and configuration binding.
Playground/WorkerService/*.cs Adds sample applications to demonstrate usage of the new component.
Files not reviewed (12)
  • Aspire.sln: Language not supported
  • Directory.Packages.props: Language not supported
  • playground/AzureAppConfiguration/AppHost/AppHost.csproj: Language not supported
  • playground/AzureAppConfiguration/AppHost/Properties/launchSettings.json: Language not supported
  • playground/AzureAppConfiguration/AppHost/appsettings.Development.json: Language not supported
  • playground/AzureAppConfiguration/AppHost/appsettings.json: Language not supported
  • playground/AzureAppConfiguration/WorkerService/Properties/launchSettings.json: Language not supported
  • playground/AzureAppConfiguration/WorkerService/WorkerService.csproj: Language not supported
  • playground/AzureAppConfiguration/WorkerService/appsettings.Development.json: Language not supported
  • playground/AzureAppConfiguration/WorkerService/appsettings.json: Language not supported
  • playground/Directory.Packages.props: Language not supported
  • src/Components/Aspire.Azure.Data.AppConfiguration/Aspire.Azure.Data.AppConfiguration.csproj: Language not supported

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 1, 2025
@davidfowl davidfowl changed the title Add Azure App Configuration component Add Azure App Configuration client integration Apr 1, 2025
@zhiyuanliang-ms zhiyuanliang-ms force-pushed the zhiyuanliang/app-config-component branch from a792085 to 316eb9d Compare April 1, 2025 07:16
@zhiyuanliang-ms
Copy link
Contributor Author

@dotnet-policy-service agree company="Microsoft"


See the [Azure.Data.AppConfiguration documentation](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/appconfiguration/Azure.Data.AppConfiguration/README.md) for examples on using the `ConfigurationClient`.

## Configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do all examples use the SDK? Mixing the provider and SDK is confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the key vault component readme

Comment on lines +9 to +18
builder.Configuration.AddAzureAppConfiguration(
"appconfig",
configureOptions: options => {
options.UseFeatureFlags();
options.ConfigureRefresh(refresh =>
{
refresh.RegisterAll();
});
builder.Services.AddSingleton(options.GetRefresher());
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the minimal configuration. Why are there 3 layers of nested lambdas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the minimal configuration. The minimal configuration is just:

builder.Configuration.AddAzureAppConfiguration("appconfig");

But to use advanced feature of App Config configuration provider (e.g. feature flag, dynamic refresh), you need to configure on AzureAppConfigurationOptions

BTW, I followed the existing pattern of AddAzureKeyVaultSecrets.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this sample is just trying to show both calls but we dont expect people to do this right?

Copy link
Contributor Author

@zhiyuanliang-ms zhiyuanliang-ms Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this sample is just trying to show both calls but we dont expect people to do this right?

If people want to use advanced features of Azure App Configuration. They should write code just like what I did in the example. We do expect people to do this if they want to use feature flag and dynamic refresh. But for simple configuration scenario, builder.Configuration.AddAzureAppConfiguration("appconfig"); is enough.

BTW, I am working on another PR: zhiyuanliang-ms#5

We decided to not implement anything for ConfigurationClient from .net azure sdk. This PR should be deprecated.

The new API will be an extension method on IHostApplicationBuilder.
builder.AddAzureAppConfiguration("appconfig");

@zhiyuanliang-ms
Copy link
Contributor Author

Move to #8945

@github-actions github-actions bot locked and limited conversation to collaborators May 24, 2025
@zhiyuanliang-ms zhiyuanliang-ms deleted the zhiyuanliang/app-config-component branch June 2, 2025 14:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-integrations Issues pertaining to Aspire Integrations packages community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Azure App Config Aspire Client Integration
4 participants