How to deploy Docker Image To Azure App Service from Azure DevOps altering .env with variables

Copper Contributor

I have an Azure DevOps pipeline that builds and uploads a docker image to dockerhub.  Now I need to deploy that docker image to the Azure App Service which I have done, but I need to alter the .env file within the image depending on which environment I am deploying to.  I have a parent url and a api key that is different depending on the endpoint.  

 

I am unable to find a way to do this... Currently I am using the Deploy Azure App Service to deploy to the Web App for Containers (Linux) using that docker image.   I don't want to create a different docker image for each environment, I should be able to just pass those variables to the deploy and run a shell script to replace values right?

 

Thanks for the help as I am new to deploying docker images.

Grant

0 Replies