-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Azure App Configuration - Update sample to use configuration provider to consume feature flag and secret reference #35740
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
Azure App Configuration - Update sample to use configuration provider to consume feature flag and secret reference #35740
Conversation
There was a problem hiding this 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 PR updates Azure App Configuration samples to use the configuration provider library instead of directly using the SDK for feature flags and secret references. The Azure App Configuration team wants customers to use the configuration provider library as it provides better support for features like feature flags and secret references that are not suitable for direct SDK usage.
Key changes:
- Replace direct SDK usage with configuration provider pattern for both feature flags and secret references
- Add new dependencies on
@azure/app-configuration-provider
and@microsoft/feature-management
packages - Simplify sample code by removing complex parsing and filtering logic in favor of provider-based consumption
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
secretReference.ts (TypeScript) |
Updated to use configuration provider for secret reference resolution instead of manual parsing |
featureFlag.ts (TypeScript) |
Replaced direct SDK feature flag manipulation with configuration provider and feature management library |
package.json (TypeScript) |
Added dependencies for configuration provider and feature management libraries |
secretReference.js (JavaScript) |
JavaScript version of the updated secret reference sample |
featureFlag.js (JavaScript) |
JavaScript version of the updated feature flag sample |
package.json (JavaScript) |
Added dependencies for JavaScript samples |
secretReference.ts (samples-dev) |
Development version of the updated secret reference sample |
featureFlag.ts (samples-dev) |
Development version of the updated feature flag sample |
package.json (main) |
Added dev dependencies for the new libraries |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
sdk/appconfiguration/app-configuration/samples/v1/javascript/featureFlag.js:1
- Missing import statements for the configuration provider and feature management libraries. These require statements should be added after the existing imports.
// Copyright (c) Microsoft Corporation.
sdk/appconfiguration/app-configuration/samples/v1/javascript/featureFlag.js
Outdated
Show resolved
Hide resolved
…or-js into zhiyuanliang/update-app-config-sample
sdk/appconfiguration/app-configuration/samples-dev/featureFlag.ts
Outdated
Show resolved
Hide resolved
sdk/appconfiguration/app-configuration/samples-dev/featureFlag.ts
Outdated
Show resolved
Hide resolved
…or-js into zhiyuanliang/update-app-config-sample
Packages impacted by this PR
Issues associated with this PR
Describe the problem that is addressed by this PR
The Azure App Configuration team developed configuration provider library. It is built on the azure sdk. The Azure App Configuration team really wants the customers to use the configuration provider library.
For a long time, we did not provide a configuration provider library for JavaScript development. As a result, a large number of users have been relying on the Azure JS SDK, which is a problem for us. Many features, such as feature flags and secret references, are not suitable for direct usage through the SDK. The samples for feature flags and secret references in the SDK repo serve as misleading examples. This has even polluted the answers generated by current AI models.
What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
Are there test cases added in this PR? (If not, why?)
Provide a list of related PRs (if any)
Command used to generate this PR:**(Applicable only to SDK release request PRs)
Checklists