--environment-variable Key=Value, cannot input double quote in the Value.
I need to set a JSON in the value, tried many formats, my double quote always got removed! e.g. none of below work! (it works when submitting az command, but lost the double quotes in the env var.) key='{"foo":"bar"}' key='{"foo":"bar"}' key="{"foo":"bar"}"
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 2e5d1da7-7c4f-c9e6-e4b9-a30407675acf
- Version Independent ID: ba32e12d-8283-f980-e1d0-1ca2a75a5152
- Content: az container
- Content Source: src/azure-cli/azure/cli/command_modules/container/_help.py
- Service: container-service
- GitHub Login: @rloutlaw
- Microsoft Alias: routlaw
@BellaLi please take a look at this doc related to quoting usage.
Thanks. @fengzhou-msft The quoting usage is help in the sense to make az command pass, it doesn't help keeping those double quotes in container's env vars. I changed to use azure template deployment, and managed to make it work!
@BellaLi was this issue resolved?
@BellaLi, could you share the command you run to set env vars and use them with Azure CLI?
I tested in Bash but couldn't repro:
$ export JSON_ENV='{"foo":"bar"}'
$ echo $JSON_ENV
{"foo":"bar"}
$ az $JSON_ENV --debug
Command arguments: ['{"foo":"bar"}', '--debug']
Azure CLI does receive the JSON correctly.
add to S168
@BellaLi, any update?
Close this issue since there is no response for more than 1 month, please help create a new issue if you still have questions.