Retrieving ACR image SHA using Azure REST API

Samuel Thelaus 0 Reputation points
2024-05-22T14:48:43.0166667+00:00

I am trying to retrieve the SHA (digest) from an ACR image with a specific tag using Azure API. I am able to use the manifests API to get digests for the manifests of a tag, however, this is not digest I am after.

I would like to retrieve the digest that is clearly visible under the "Essentials" tab of the image tag page in Azure Portal (see image).

enter image description here

I am wondering if there's a way to use the API to get this digest. I would like to avoid using AZ CLI or pulling the image.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
422 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
236 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 25,616 Reputation points
    2024-05-23T10:41:31.09+00:00

    Hello Samuel Thelaus

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    I just tried by passing the repository name and I am able to get the Digest SHA value that is shown under the essentials of ACR image on Azure portal https://video2.skills-academy.com/en-us/rest/api/containerregistry/tag/get-attributes?view=rest-containerregistry-2019-08-15&tabs=HTTP

    GET {url}/acr/v1/{name}/_tags/{reference}
    

    User's image

    User's image

    Hope this helps.

    0 comments No comments