Azure App Service (Windows) Config Variable

Highlighted
Contributor

I'm having an issue reading env variables on Azure App Service Windows instance. I use dotenv nodejs package for storing my env variables in .env file. It works perfectly fine on my local machine (Windows 10), but the same does not when hosted on a Windows App service. I tried some troubleshooting by printing out the env variables at run time and I get blank output for the same. Somehow it's not able to read the variables in the .env file.

 

I also ensured that the .env file and the entries are intact on the deployed host by logging onto the console in the portal.

 

What am I doing wrong?

2 Replies
Highlighted

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

Screenshot_145.png

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

Highlighted

@akhilvattsThat did the trick. Thanks for letting me know of this.