Azure – Set Environment Variables on Azure App Service (Docker Instance)

azureazure-web-apps

When creating an App Service in Azure and selecting Docker Container as a type of App, where do you set Environment Variables?

My App is built in Azure by:
1. Create Resource > App Service > Publish > Choose Docker Image (rather than code)
2. Point to Docker container in Azure registry.

The app builds fine, but I wish to pass in environment variables during the docker run command (on other services you simply set environment variables). When the app builds, you can see in the logs the app service runs" docker run…." and passes in –env variables. Like so

"docker run -d -p 56996:80 –name nameofapp_7 -e WEBSITE_SITE_NAME=AngularApp"

What I need to know is where in the Azure Portal can you set the variables to be passed into the run command. i.e. WEBSITE_SITE_NAME ?

Best Answer

Any app settings you configure in the web application are passed into the container as environment variables. You can configure these in the portal, through CLI or ARM Template.

Related Topic