azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

--environment-variable Key=Value, cannot input double quote in the Value.

Open BellaLi opened this issue 6 years ago • 7 comments

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.

BellaLi avatar Jan 28 '20 01:01 BellaLi

@BellaLi please take a look at this doc related to quoting usage.

fengzhou-msft avatar Jan 28 '20 02:01 fengzhou-msft

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 avatar Jan 28 '20 22:01 BellaLi

@BellaLi was this issue resolved?

yonzhan avatar Feb 02 '20 02:02 yonzhan

@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.

jiasli avatar Feb 05 '20 08:02 jiasli

add to S168

yonzhan avatar Mar 08 '20 02:03 yonzhan

@BellaLi, any update?

yonzhan avatar Mar 08 '20 02:03 yonzhan

Close this issue since there is no response for more than 1 month, please help create a new issue if you still have questions.

qianwens avatar Mar 08 '20 07:03 qianwens