filterazure-cliazure-app-configurationazure-feature-manager

Encountering "Some of your feature flags are not valid. Please navigate to Advanced Edit for more details." error in App Configuration


Trying to add new user in Microsoft.Targeting filter, but getting error: "Some of your feature flags are not valid. Please navigate to Advanced Edit for more details." enter image description here

Advanced Edit output using my script

enter image description here

Anticipated Result (The expected output should resemble the screenshot provided below):

enter image description here

Az Cli Command :

az appconfig feature filter update --connection-string <<Endpoint Connection String here>> --feature featureA --filter-name Microsoft.Targeting --filter-parameters '"\"Audience\": {\"Users\": [\"user1\",\"user2\",\"user3\"],\"Groups\": [],\"DefaultRolloutPercentage\": 50}}"'

Unable to read Json file data and pass those values to --function-parameters value


Solution

  • The syntax for adding filter parameters is in the form parameterName=value. If the "value" is JSON, then it must be escaped. More information on this can be found in the command documentation here.

    So the command would work as expected if rewritten as follows:

    az appconfig feature filter update --connection-string <<Endpoint Connection String here>> --feature featureA --filter-name Microsoft.Targeting  --filter-parameters 'Audience={\"Users\": [\"user1\",\"user2\",\"user3\"],\"Groups\": [],\"DefaultRolloutPercentage\": 50}'
    

    I hope this helps, thanks!