0

I'm gonna fetch the latest image from ACR repository which doesn't include a specific prefix: Here is what I have now:

$ az acr repository show-tags --name myacr --repository myrepo --orderby time_desc --top 1 --output tsv

The list of images are like this:

"prefix-7471",
"prefix-7470",
"7469",
"prefix-7467",
"prefix-7466",
"prefix-7459",
"7455",
...

The above command shows the tag : "prefix-7471" as output however I want it to fetch tag: "7469"

Is there anyway that I can get this?

Matrix
  • 2,399
  • 5
  • 28
  • 53

1 Answers1

0

how about using grep?

az acr repository show-tags --name myacr --repository myrepo --orderby time_desc \
    --output tsv | grep -v "prefix"

and then you can take the first string from the output

ps. I dont think you can do notcontains jmespath query?

4c74356b41
  • 69,186
  • 6
  • 100
  • 141