I'm trying to extract information from a text file and store the content in a variable using the Azure CLI command below.
file_content=$(cat /home/diwakar/cli.txt)
echo $file_content
After running the above command, the following output was obtained (Same content I have cli.txt file):
Output:
Audience={"Users":["user1","user2","user4","user3"],"Groups":[],"DefaultRolloutPercentage":50}
When I run the actual command, the variable takes on a different value, leading to an error.
az appconfig feature filter update --connection-string $endpoint --feature $featurename --filter-name Microsoft.Targeting --filter-parameters $file_content --yes
Below is the error message:
Filter parameter value must be a JSON escaped string. "{"Users":["user1","user2","user4","user3"],"Groups":[],"DefaultRolloutPercentage":50}" is not a valid JSON object.




az appconfig feature filter update