I see you can untag an image in an Azure Container Registry
But how do you add a tag?
As far as I know. There is no Azure CLI command to create a tag for the images directly. If you want to add a tag for the image, you just can use the docker command docker tag
to add the tag and then push the image to Azure Container Registry.
When you create the image through the build task, it also will lead to the tag adding. Take a look at this.
I had overwrite an existing tag with an latest build inside a release pipeline. So I could not do a build step since its inside a release pipeline. This is my solution hope this helps someone:
This is my release pipeline: Step 1
task 1: Docker CLI installer
task 2: Docker Task - with login command(log into the ACR)
task 3: Powershell script: which runs these commands (in my case )
$sourceImage= "acrloginserver/repository:old-tag";
$newtag= "acrloginserver/repository:latest-tag"
docker pull $sourceImage
docker tag $sourceImage $newtag
docker push $newtag`