AppConfiguration icon indicating copy to clipboard operation
AppConfiguration copied to clipboard

Cli parsing issue for a custom feature filter

Open sajal-mukherjee-git opened this issue 9 months ago • 8 comments

As per the documentation here syntax for updating a custom feature filter

az appconfig feature filter update -n MyAppConfiguration --feature color --label MyLabel --filter-name MyFilter --filter-parameters Name=\"Value\" Name2=\"Value2\"

however, in practice this result in the following error

Filter parameter value must be a JSON escaped string. "\Value" is not a valid JSON object.

Note the stragnge escape \ on "\Value\" in the error message. Not sure where this is coming from

sajal-mukherjee-git avatar Mar 03 '25 14:03 sajal-mukherjee-git

Thanks for triaging this @zhenlan, @ChristineWanjau.

Is there an ETA when this can be adressed? We have features that we are unable to deploy through CI/CD pipeline due to this.

sajal-mukherjee-git avatar Mar 04 '25 07:03 sajal-mukherjee-git

Hello @sajal-mukherjee-git just wanted to confirm which cli version are you using?

ChristineWanjau avatar Mar 04 '25 07:03 ChristineWanjau

Hello @sajal-mukherjee-git just wanted to confirm which cli version are you using?

Hi, from az --version I get this

azure-cli                         2.61.0 *

core                              2.61.0 *
telemetry                          1.1.0

Dependencies:
msal                              1.28.0
azure-mgmt-resource               23.1.1

sajal-mukherjee-git avatar Mar 04 '25 07:03 sajal-mukherjee-git

@ChristineWanjau the issue persists on latest 2.70.0 as well.

sajal-mukherjee-git avatar Mar 04 '25 10:03 sajal-mukherjee-git

Thanks just verified it, I can also see the issue on my end. Could you try doing this instead: az appconfig feature filter update -n MyAppConfiguration --feature color --label MyLabel --filter-name MyFilter --filter-parameters Name='\"Value\"' Name2='\"Value2\"' --index 2

Please let me know if this works. The parameter values should be JSON escaped strings.

ChristineWanjau avatar Mar 04 '25 11:03 ChristineWanjau

Thanks just verified it, I can also see the issue on my end. Could you try doing this instead: az appconfig feature filter update -n MyAppConfiguration --feature color --label MyLabel --filter-name MyFilter --filter-parameters Name='\"Value\"' Name2='\"Value2\"' --index 2

Please let me know if this works. The parameter values should be JSON escaped strings.

Hi @ChristineWanjau,

This is working! I tried without the --index 2 and that works as well.

Is this by design ?

sajal-mukherjee-git avatar Mar 04 '25 13:03 sajal-mukherjee-git

@sajal-mukherjee-git thanks for verifying it works. We will update our help text reflect this.

I tried without the --index 2

This is just the zero-based index of the filter to be updated in case there are multiple instances with same filter name. It's not required.

Is this by design ?

Do you mean having the value as a json escaped string?

ChristineWanjau avatar Mar 04 '25 13:03 ChristineWanjau

@sajal-mukherjee-git thanks for verifying it works. We will update our help text reflect this.

I tried without the --index 2

This is just the zero-based index of the filter to be updated in case there are multiple instances with same filter name. It's not required.

Is this by design ?

Do you mean having the value as a json escaped string?

Yes, that the keys are not escaped but the values are, alsp the need for single quotes '

sajal-mukherjee-git avatar Mar 04 '25 13:03 sajal-mukherjee-git

This known parsing issue with powershell - https://github.com/Azure/azure-cli/blob/dev/doc/quoting-issues-with-powershell.md You can either use the stop parsing symbol or wrap it in single quotes as a workaround.

az --% appconfig feature filter update -n MyAppConfiguration --feature color --label MyLabel --filter-name MyFilter --filter-parameters Name=\"Value\" Name2=\"Value2\"

or az appconfig feature filter update -n MyAppConfiguration --feature color --label MyLabel --filter-name MyFilter --filter-parameters Name='\"Value\"' Name2='\"Value2\"'

ChristineWanjau avatar Sep 01 '25 08:09 ChristineWanjau