Search code examples
dockerazure-web-app-serviceazure-container-registry

Is it possible to convert the publish method of an App Service from Code to Docker?


I have set up an Azure App Service (Linux) publish method being Code and have set up the appropriate pipeline to build and deploy my code (nodejs). Now I need more control on the host running my code (need poppler). On dev + test I have created new App Services and have chosen Docker Container as publish method

My question: for my PROD instance, is it possible to change the publish method of my existing App Service or do I have to create a new App Service ?

Assuming the latter, I would need to update the client to point to the new App Service URL. To avoid that, could I first delete the existing App Service and create a new one with the same name ? This would make me lose all stats and logs.

Any alternative suggestions?

enter image description here


Solution

  • I turned my code-based app into a container by looking at some commands from this guide; https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container?pivots=container-linux

    The important steps:

    1. Login and select subscription etc

    2. Enable Identity and assign AcrPull role so the App Service can fetch the image

    3. This command:

      az webapp config container set --name <app-name> --resource-group <resource-group> --docker-custom-image-name <registry-name>.azurecr.io/appsvc-tutorial-custom-image:latest --docker-registry-server-url https://<registry-name>.azurecr.io

    4. Now the webapp "Deployment Center" shows Single Container with credentials, registry and Webhook URL setup