2

I have two questions regarding ACR image pulling.

  1. Is there a possibility to get the pull count of an ACR docker image?
  2. Can we get the details of docker images that are not pulled for a specific time period? For example, the images that are not pulled for the last 7 days?
  • 1
    You can enable the diagnostic settings (to collects both platform metrics & activity logs) on your container registry & sending those logs data to log analytics workspace. In log analytics workspace the data is stored in the table format using kusto queries you can get the required data You can refer this documentation (https://learn.microsoft.com/en-us/azure/container-registry/monitor-service#collection-and-routing) for more information. – VenkateshDodda Dec 16 '21 at 14:35

1 Answers1

2
  1. Is there a possibility to get the pull count of an ACR docker image?
  2. Can we get the details of docker images that are not pulled for a specific time period? For example, the images that are not pulled for the last 7 days?

As I have mentioned above in the comments, You can achieve this by enabling the diagnostic settings on the container registry & passing those logs to log analytics workspace. you can write some custom kusto queries & pull the logs based on your requirement.

The below query can help in getting the pull count of an image from acr over a period of time.

ContainerRegistryRepositoryEvents| where ArtifactType contains "acr.docker"
|where Repository contains "<repoName>" and Tag contains "<TagName>"
| where OperationName contains "Pull"
| where TimeGenerated > ago(24h)
| count 

You can refer this documentation for more sample Kusto queries.

VenkateshDodda
  • 4,723
  • 1
  • 3
  • 12