How to activate settings in the web app when deployed as deployment-container-image-name

AZURE ME2Digital 1 Reputation point
2021-01-14T14:03:07.947+00:00

I have deployed a "Container Image" on to Web App Service with the following command.

az webapp create --name Dev-App --plan Dev-AppServicePlan \
--resource-group Dev \
--deployment-container-image-name ...devcontainerregistry.azurecr.io/app-node:latest

After the app was successfully deploment I need to change some Environment variables via the following commands.

az webapp config appsettings set --name Dev-App --resource-group Dev \
--settings MONGO_DSN='mongodb://cosmosdb...'

az webapp config appsettings set --name Dev-App --resource-group Dev \
--settings REDIS_URI='...dev.redis.cache.windows.net:6380...'

az webapp log config --name Dev-App --resource-group Dev \
--docker-container-logging filesystem

Now I have updated and restarted the Web App but it looks like the Image is not redeployed or at least the Environment variables are not there.

az webapp update --name Dev-App --resource-group Dev
az webapp restart --name Dev-App --resource-group Dev

I looked with log tail to the logs but the logs are also not changed. What I mean with "not changed" is that the log output is stucked to the Timestamp "2021-01-13T13:21:31.100Z" even when I restart the Web App.

az webapp log tail --name Dev-App --resource-group Dev

In this Articles from MS is described that a restart should be enough but then should also the log output should be changed.

2: Redeploy a container to Azure App Service after making changes
Configure a custom container for Azure App Service

Any hint how to activate the new settings in the custom image setup or trigger a redeployment?

I have also created a SO question How to activate settings in the web app when deployed as deployment-container-image-name there was a answer to try to use docker swarm but It should be also possible to redeploy a custom image without docker swarm, IMHO.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,912 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 22,416 Reputation points Microsoft Employee
    2021-01-20T18:54:48.813+00:00

    To benefit the community, posting (copying) the solution shared by Aleksandar on the SO thread.

    "Well the solution for my problem was that I change the registry from "Private Registry" to "Azure Container Registry" in the "container settings" page after
    running the following command:

    az webapp create --name Dev-App \
    --plan Dev-AppServicePlan \
    --resource-group chat-Dev \
    --deployment-container-image-name devcontainerregistry.azurecr.io/chat-node:latest**

    I have put the acr data into the fields and activated the "Continous Deployment"

    58707-image.png

    After this change every settings change triggers a restart and the ENV Variables was in the new instance. "

    Thank you Aleksandar (@AZURE ME2Digital ) for sharing the solution that worked for you, it will benefit the users with a similar issue. Much appreciate the follow-up.

    0 comments No comments