Cli parsing issue for a custom feature filter
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
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.
Hello @sajal-mukherjee-git just wanted to confirm which cli version are you using?
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
@ChristineWanjau the issue persists on latest 2.70.0 as well.
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.
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 2Please 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 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?
@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 '
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\"'