title: How do I setup Azure Pipelines to release to Azure App Service with multiple docker containers?
body: <p>I am in the early stages of a development project -- and trying to nail down the CI/CD pipeline. I am running into some confusion while trying to deploy multiple docker containers into a single Azure App Service. Here is the outline of what I am trying to achieve, with as much detail along the way. Any guidance on where I am going wrong would be very appreciated. I've put checkmarks next to the items I
  <em>believe</em> I already have configured correctly.</p>
  <ol> <li>Merge code to the master branch of a Github repository ✔</li> <li>Have an Azure DevOps Pipeline automatically trigger✔ <ul> <li>Build all of my services by running the docker-compose.yml file (this file was autogenerated by Visual Studio), tagging them with the current build id</li> <li>Push all of the images into my azure container registry</li> <li>Copy my docker-compose.yml to the artifact staging folder</li> <li>Publish the artifact staging folder</li> <li>YML that achieves:</li>
  <pre><code>trigger:
  - main
  
  pool:
    vmImage: 'ubuntu-latest'
  
  steps:
  - task: DockerCompose@0
    inputs:
      containerregistrytype: 'Azure Container Registry'
      azureSubscription: 'MYSUB'
      azureContainerRegistry: 'MYACR'
      dockerComposeFile: '**/docker-compose.yml'
      action: 'Build services'
      additionalImageTags: $(Build.BuildId)
  - task: DockerCompose@0
    inputs:
      containerregistrytype: 'Azure Container Registry'
      azureSubscription: 'MYSUB'
      azureContainerRegistry: 'MYACR'
      dockerComposeFile: '**/docker-compose.yml'
      action: 'Push services'
      includeSourceTags: true
      includeLatestTag: true
      additionalImageTags: $(Build.BuildId)
  - task: CopyFiles@2
    inputs:
      Contents: '**/docker-compose.yml'
      TargetFolder: '$(Build.ArtifactStagingDirectory)'
      OverWrite: true
  
  - task: PublishBuildArtifacts@1
    inputs:
      PathtoPublish: '$(Build.ArtifactStagingDirectory)'
      ArtifactName: 'drop'
      publishLocation: 'Container'
  </code></pre>
  <li>docker-compose.yml (names generalized)
  <pre><code>version: '3.4'
  
  services:
    service1:
      image: ${DOCKER_REGISTRY-}service1
      build:
        context: .
        dockerfile: src/PROJECTNAMEHERE/Dockerfile
  
    api1:
      image: ${DOCKER_REGISTRY-}api1
      build:
        context: .
        dockerfile: src/PROJECTNAMEHERE/Dockerfile
  
  
    service2:
      image: ${DOCKER_REGISTRY-}service2
      build:
        context: .
        dockerfile: src/PROJECTNAMEHERE/Dockerfile
  </code></pre>
  </li> </ul> </li> <li>Have an Azure DevOps Release Pipeline with multiple stages for release to QA/Prod environments ❌ <ul> <li>Add a variable to be set at Release Creation for which BuildId (from the pipeline laid out above) I'm looking to target</li> <li>Add the artifact from above</li> <li>Have 2 stages, QA and Prod</li> <li>Each stage simply runs a "Azure Web App on Container Deploy" task <ul> <li>I set "Image name" equal to my 3 services from the ACR
  <pre><code>myacrrepo.azurecr.io/service1:$(BuildId)
  myacrrepo.azurecr.io/api1:$(BuildId)
  myacrrepo.azurecr.io/service2:$(BuildId)
  </code></pre>
  </li> <li>I set "Configuration File" to the docker-compose.yml in the artifact
  <pre><code>$(System.DefaultWorkingDirectory)/_david#####.#####/drop/docker-compose.yml
  </code></pre>
  </li> <li>YML for this step
  <pre><code>steps:
  - task: AzureWebAppContainer@1
    displayName: 'Azure Web App on Container Deploy'
    inputs:
      azureSubscription: 'MYSUB'
      appName: myapname
      containers: |
        myacrrepo.azurecr.io/service1:$(BuildId)
        myacrrepo.azurecr.io/api1:$(BuildId)
        myacrrepo.azurecr.io/service2:$(BuildId)
      multicontainerConfigFile: '$(System.DefaultWorkingDirectory)/_david#####.#####/drop/docker-compose.yml'
  </code></pre>
  </li> </ul> </li> </ul>
  </li> </ol>
  <p>When all is said and done, and this release pipeline runs -- my App Service ends up being configured to grab its images from Docker Hub -- and the container images fail to pull because there are no docker hub credentials filled and the image names on my docker-compose.yml file aren't valid (e.g., &quot;${DOCKER_REGISTRY-}api1&quot;)</p>
  <p>I've never used docker before, so I'm struggling to get through this properly. I've tried to include as much info as possible, if there is something else you'd need please let me know -- again any help is much appreciated.</p>