title: Request access denied when trying to push to azure container registry from azure dev ops
body: <p>keep getting this error when I try and push to azure container registry which I have connected up in the 'service connections' as 'containerregistry'</p>
  <pre><code>trigger:
  - master
  
  resources:
  - repo: self
  
  variables:
    tag: '$(Build.BuildId)'
    azureContainerRegistry: containerregistry
    azureSubscriptionEndpoint: resourcemanager
  
  stages:
  - stage: Build
    displayName: Build image
    jobs:  
    - job: Build
      displayName: Build
      pool:
        vmImage: 'ubuntu-latest'
      steps:
      - task: DockerCompose@0
        displayName: Build services
        inputs:
          action: Build services
          azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
          azureContainerRegistry: $(azureContainerRegistry)
          dockerComposeFile: docker-compose.yml
          projectName: $(Build.Repository.Name)
          qualifyImageNames: true
          additionalImageTags: $(Build.BuildId)
      - task: DockerCompose@0
        displayName: Push services
        inputs:
         action: Push services
         azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
         azureContainerRegistry: $(azureContainerRegistry)
         dockerComposeFile: docker-compose.yml
         projectName: $(Build.Repository.Name)
         qualifyImageNames: true
         additionalImageTags: $(Build.BuildId)
         includeLatestTag: true
  
  </code></pre>
  <p>the build will work fine but when it tries to push the image i get the following</p>
  <blockquote>
  <p>[command]/usr/bin/docker push csym023container/csym023_api</p>
  <p>The push refers to repository [docker.io/csym023container/csym023_api]</p>
  <p>e7a7b94f6564: Preparing</p>
  <p>....etc.....</p>
  <p>2c6ac8e5063e: Waiting</p>
  <p>denied: requested access to the resource is denied</p>
  <p>[error]denied: requested access to the resource is denied</p>
  <p>[error]The process '/usr/bin/docker' failed with exit code 1</p>
  <p>[section]Finishing: Push services</p>
  </blockquote>
  <p><a href="https://pastebin.com/24z2xYyb" rel="nofollow noreferrer">full debug output</a></p>
  <p>It looks like it's trying to push to docker.io for some reason, I did read <a href="https://stackoverflow.com/questions/55421635/resource-access-denied-when-pushing-container-to-azure-container-registry">here</a> that you need the login URL which I did try but then I get an error about authorization which I don't know how to implement in the pipeline file.</p>
  <blockquote>
  <p>[command]/usr/bin/docker push csym023.azurecr.io/csym023_api</p>
  <p>The push refers to repository [csym023.azurecr.io/csym023_api]</p>
  <p>f29018588af0: Preparing</p>
  <p>...etc ...</p>
  <p>cc967c529ced: Waiting</p>
  <p>unauthorized: authentication required</p>
  <p>[error]unauthorized: authentication required</p>
  <p>[error]The process '/usr/bin/docker' failed with exit code 1</p>
  <p>[section]Finishing: Push services</p>
  </blockquote>
  <p><a href="https://pastebin.com/U85w189M" rel="nofollow noreferrer">full debug output</a></p>