Webapp:Support env file style files for @arguments
See original GitHub issueTo configure the environment of my webapp for containers, I’m running this:
az webapp config appsettings set -g "$RG" -n "$NAME" --settings WEBSITES_PORT=3000 "@$CONFIG"
$CONFIG is a file containing several environment variables. It works great when the file is in JSON format, but it works weirdly when the file in in “env file” format (similar to the format that is supported by docker run --env-file <file>
): it only use the first key, then everything else as the value.
For example
KEY1=value1
KEY2=value2
is parsed as
KEY1=value1\nKEY2=value2
(and same with windows style end of line)
Describe the solution you’d like
I think it would be great to work well with env files, so that environment setup can be made more consistent with the way it’s done on docker cli
Describe alternatives you’ve considered
Converting the config file to JSON works well, but it’s not consistent with the way docker cli works (and other docker environments too, for example AWS ECS allows to have an env file on S3), so it adds more step when explaining to a customer how to setup our software on Azure, vs other docker hosting solution.
Additional context
N/A
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top GitHub Comments
Thanks for the workaround, @zboldyga. As someone who’s new to this, the documentation was somewhat confusing - it’s mentioned that you can provide a file, and the example uses a json file, but it’s not specified that it’s your only option. I expected to be able to import a .env file, too, considering I’m running a container.
Sorry to ask, but is there any plan to work on this soon? (I saw that it was put in S174, but it’s not anymore, I’m not sure what it means?) - I’m just asking to know if I can count on it or not.
Thanks!