Skip to content

Conversation

amerjusupovic
Copy link
Contributor

This PR adds the environment variable AZURE_APP_CONFIGURATION_FM_SCHEMA_COMPATIBILITY_DISABLED. When set to true, the provider will process and output all feature flags as the newer Microsoft schema. If false, the provider will function as it does today where a flag is only processed in the Microsoft schema if any of the variants, allocation, or telemetry properties are present.

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 PR introduces an environment variable to disable schema compatibility logic in the feature management provider, forcing all feature flags to use the Microsoft schema when enabled.

  • Add AZURE_APP_CONFIGURATION_FM_SCHEMA_COMPATIBILITY_DISABLED support in FeatureManagementKeyValueAdapter
  • Update conditional logic to respect the new environment variable
  • Add a new unit test covering forced Microsoft schema behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Microsoft.Extensions.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs Read the new environment variable and adjust schema selection logic
tests/Tests.AzureAppConfiguration/Unit/FeatureManagementTests.cs Add test verifying behavior when the environment variable is set or unset
Comments suppressed due to low confidence (2)

src/Microsoft.Extensions.Configuration.AzureAppConfiguration/FeatureManagement/FeatureManagementKeyValueAdapter.cs:22

  • [nitpick] Consider renaming this constant to DisableFmSchemaCompatibilityEnvironmentVariableName to clearly indicate it holds the environment variable name.
        private const string DisableFmSchemaCompatibilityEnvironmentVariable = "AZURE_APP_CONFIGURATION_FM_SCHEMA_COMPATIBILITY_DISABLED";

tests/Tests.AzureAppConfiguration/Unit/FeatureManagementTests.cs:2345

  • Add a unit test for explicitly setting the environment variable to an invalid value (e.g., "notabool") to verify the default behavior fallback.
            // Act - Verify normal behavior when environment variable is not set

amerjusupovic and others added 3 commits June 17, 2025 13:42
jimmyca15
jimmyca15 previously approved these changes Jul 15, 2025
@zhiyuanliang-ms zhiyuanliang-ms self-assigned this Jul 16, 2025
@zhiyuanliang-ms zhiyuanliang-ms merged commit 4dad36e into main Jul 20, 2025
3 of 4 checks passed
This was referenced Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Defining features using MicrosoftSchema in AzureAppConfiguration and appsetting.json does not work when not using variants
3 participants