Deploying multiple docker images on a single azure web app using Azure DevOps

Hikmet 20 Reputation points
2023-04-13T08:28:32.95+00:00

Dear All,

Acronyms: Azure DevOps (ADO), Azure Container Registry (ACR), Azure Web App (AWA).

Having the following ADO pipeline, I am able to build an image X, push X to container registry and deploy X on AWA correctly. User's image

Below you can find the content of Azure Web App on Container Deploy: User's image

Having two more build and push jobs to build and push another Y image to ACR, how can I deploy both X and Y in AWA using Azure Web App on Container job?

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
406 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,047 questions
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,356 Reputation points Microsoft Employee
    2023-04-17T02:36:07.7633333+00:00

    Hello! It seems like you are trying to deploy multiple Docker images on a single Azure Web App using Azure DevOps. I'll do my best to help you out. Based on your description, it seems like you have already created a Docker Compose file that includes both of your images. That's a great start! To deploy both X and Y in AWA on a Container job, you can follow these steps:

    1. In your Azure DevOps pipeline, add a new task to deploy your Docker Compose file to your Azure Web App. You can use the "Azure CLI" task to run the necessary commands.
    2. In the "Azure CLI" task, run the following command to deploy your Docker Compose file:
       <span class=" active-doc-2" data-doc-items="2">az webapp create --resource-group <resource-group-name> --plan <app-service-plan-name> --name <web-app-name> --multicontainer-config-file <path-to-docker-compose-file[2](#doc-pos=2)</span>>
       
    

    Replace <resource-group-name>, <app-service-plan-name>, <web-app-name>, and <path-to-docker-compose-file> with the appropriate values for your environment.

    1. Once the Docker Compose file is deployed, both of your images should be running on your Azure Web App. You can access the APIs of your main-flask-app by using the appropriate URL and port number. In your Docker Compose file, you have mapped port 5002 of the main-flask-app container to port 5002 on the host. So, you should be able to access the APIs of main-flask-app at http://<web-app-name>.azurewebsites.net:5002. I hope this helps! Let me know if you have any further questions.
    0 comments No comments