question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webapp:Support env file style files for @arguments

See original GitHub issue

To 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
flammablecommented, Jun 24, 2022

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.

2reactions
fortycommented, Aug 25, 2020

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using .env in .NET - Dusted Codes
Dotenv (.env) files are a great way of making that easy! ... A .env file is essentially just a flat file specifying environment...
Read more >
Goodbye ENV Files - Doppler
Three months ago we stopped using ENV files as the default export option in the Doppler CLI. This change led to a number...
Read more >
How to pass environment variables at building time in an ...
Basically, the solution is to create the environment.ts file at building time. The .env files. If you do not know what ...
Read more >
Environment Variables - Remix
If you're using the remix dev server to run your project locally, it has built-in support for dotenv. First, create an .env file...
Read more >
Environment variables in Compose | Docker Documentation
The .env file feature only works when you use the docker-compose up command ... Other extended shell-style features, such as ${VARIABLE/foo/bar} , are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found