AZ-204 Developing Solutions for Microsoft Azure Exam
You can develop, but can you develop for the cloud? Harness your development skills and learn how to create robust solutions for Microsoft Azure, aiming for your Microsoft Certified: Azure Developer Associate certification!
Practice Test

Practice Test

Publish an image to Azure Container Registry
Implement and Execute Image Publishing Commands
Publishing an image to Azure Container Registry (ACR) involves using both Azure CLI and Docker commands. Azure CLI handles registry creation and configuration, while Docker works with your local images. Proper versioning and smooth deployment depend on correctly tagging and pushing images. This process ensures your container images are secure and accessible for services like AKS or Container Instances.
To create and configure your ACR instance, you use the Azure CLI. First, provision the registry with:
az acr create --resource-group <rg> --name <registryName> --sku Standard
az acr update --name <registryName> --admin-enabled true
az acr login --name <registryName>
These commands provision the registry, enable administrative access, and authenticate your session. After login, your CLI context points to the new ACR.
Next, you need to tag your local image so ACR can recognize it. List your images with docker images
, then run:
docker tag <localImage> <registryName>.azurecr.io/<repoName>:<tag>
Here, v1
). Accurate tagging makes it easy to track and manage images in DevOps workflows.
Once tagged, push the image up to your registry with:
docker push <registryName>.azurecr.io/<repoName>:<tag>
Pushing uploads the image layers to ACR so they’re stored and ready for use. You can verify the upload by running:
az acr repository list --name <registryName> --output table
az acr repository show-tags --name <registryName> --repository <repoName> --output table
These commands confirm your image is stored and tagged correctly.
After the image is in ACR, you can manage and deploy it across environments. Common tasks include:
- Removing the local image with
docker rmi <registryName>.azurecr.io/<repoName>:<tag>
- Pulling the image elsewhere using
docker pull <registryName>.azurecr.io/<repoName>:<tag>
- Running it locally with
docker run <registryName>.azurecr.io/<repoName>:<tag>
These steps optimize storage, test deployments, and prepare images for Azure services like Kubernetes.
Conclusion
Publishing images to Azure Container Registry is a multi-step process that starts with creating and configuring your registry via Azure CLI. You then tag your local images to include registry details and version information. Next, you push those images into ACR and verify their presence with Azure CLI commands. Finally, you manage and deploy images across different environments, ensuring they are accessible, secure, and ready for production. This workflow keeps your container images organized and available for all your Azure deployments.