Forum Discussion
Azure App Service (Windows) Config Variable
eynarain Did you try setting the environment variables using the Configuration settings for your webapp?
Check out this screenshot, I guess this should help you setting your environment variables.
You may find more info on this at: https://docs.microsoft.com/en-us/azure/app-service/configure-common
I hope this solves your problem.
Thanks
- kamran888Nov 11, 2020Copper Contributor
Hi akhilvatts how do you suggest to work with Application Settings on local dev environments? Using .evn.local, .env.qa and .env.prd allows me to have specific environment variables managed through my codebase. I use the pipeline to convert .env.<environment> to .env and then inject sensitive values against keys such as password from a vault.
Managing environment variables through Application Settings means more overhead whenever I need to introduce new variables, especially non-sensitive ones.
- kamran888Nov 11, 2020Copper Contributor
It seems like this was a specific problem with my Python Flask application. Since Azure App Service uses gunicorn to start Python applications and not the Flask CLI, the .env file was not getting loaded into the project because the Flask CLI will typically load the python-dotenv package. Once I loaded it myself into main.py, it started working again.
- eynarainAug 19, 2019Brass Contributor
akhilvattsThat did the trick. Thanks for letting me know of this.