简体   繁体   中英

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. Ie 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

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

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM