'How to modify image tag on azure container registry via rest API?

Probably I am not able to follow the azure docs quickly, every single time when I try to implement something from azure API, it is always frustrating me. I feel like an idiot. This feeling I have every time when read azure docs. I.e I want to modify or add a new tag azure container registry and here is the docs. Could someone understand what is the new tag or what will be modified?

curl -SsLf -XPATCH -H "Authorization:Basic $TOKEN"  "https://my.azurecr.io/acr/v1/myrepo/_tags/latest"

I am trying to retag the latest tag as 123456789. Any idea how can I handle this?

The response:

HTTP/1.1 400 Bad Request


Solution 1:[1]

For Workround you can use this API to update the tag of container registry(Make sure to pass the existing tag and new tag as well which you are going to update else it will overwrite with new tag).

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}?api-version=2019-05-01

enter image description here

enter image description here

enter image description here

Same you test out using this Microsoft Document : https://docs.microsoft.com/en-us/rest/api/containerregistry/registries/update#code-try-0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RahulKumarShaw-MT