Search code examples
azureazure-api-managementacrazure-acr

Listing repository tags with Azure ACR API


I'm trying to send a GET request to https://acr-name.azurecr.io/v2/image-name/tags/list but I'm not sure which token to use, as I keep getting:

{
    "errors": [
        {
            "code": "UNAUTHORIZED",
            "message": "authentication required, visit https://aka.ms/acr/authorization for more information.",
            "detail": [
                {
                    "Type": "repository",
                    "Name": "image-name",
                    "Action": "metadata_read"
                }
            ]
        }
    ]
}

I tried BasicAuth but I'm still getting the error. I even tried Bearer and it still doesn't work.

I want to list all the tags of the image in my ACR.


Solution

  • You can use the basic auth with the username and password of the ACR, the name can be the admin user and password, and also can be the service principal app Id and secret which have the right permission of the ACR. Here is the screenshot that I did the test:

    enter image description here