Resource access denied when pushing container to Azure Container Registry

I’ve been attempting to push containers into a private Azure Container Registry using Docker Compose. I’ve been following the example given here and the documentation here.

There are similar answers like this one. As far as I can see, there is no way to login via Docker Compose in yaml.

Names changed for brevity. The error I am getting is:

Pushing [container] ([registry]/[app]:latest)…

The push refers to repository [docker.io/[registry]/[container]] denied: requested access to the resource is denied

In my azure-pipeline.yml file, I have the following task:

task: [email protected]
    displayName: Compose push customer API
    inputs:
        azureSubscriptionEndpoint: $(azureSubscriptionEndpoint)
        azureContainerRegistry: $(azureContainerRegistry)
        dockerComposeCommand: 'push [container]'
        dockerComposeFile: docker-compose.yml
        qualifyImageNames: true
        projectName: ""
        dockerComposeFileArgs: |
           TAG=$(Build.SourceBranchName)

I’ve tried setting containerregistrytype to “Azure Container Registry”, but this made no difference.

I have also granted the Service Principle I am using Owner access to the ACR (and the entire resource group), but this has made no difference.

One thing that stands out to in the error is “the push refers to repository [docker.io“. Should this not be *.azurecr.io, which is the ACR domain? It is almost like Azure Devops is using the non-Azure container registry type.

Is this a bug in Azure DevOps or do I need to set more permissions somewhere?

Source: StackOverflow