Azure Container Registry - List Images / Tags - Programmatically

I was facing the same puzzle for a while and the answer is:

For image operations (including the tag list you were asking about) Microsoft supports the docker registry API v2.

https://docs.docker.com/registry/spec/api

What does it mean? An Example:

Azure REST API is for Azure resource operations only. There you can use Bearer Token authentication and for example make a GET request like this:

https://management.azure.com/subscriptions/SubscriptionGUID/resourceGroups/ContainerRegistry/providers/Microsoft.ContainerRegistry/registries/YourRegistryName?api-version=2017-10-01

But as you already know this will not give you access to operations on the content of the ACR.

Instead you need to call a different end-point, namely the Registry end-point, and very importantly, you need to use basic authentication with username and password:

https://yourregistryname-on.azurecr.io/v2/imagename/tags/list

What username and password is it? Well, there are 2 types possible:

  1. The admin user you can enable on the ACR in the Azure portal
  2. You can configure users in the ACR under Access Control with different types of access (more secure). As the username you can use the underlying GUID, visible in the query string in the URL when selecting it in Azure portal. Password/key can be configured there as well.