
Azure Container Registry (ACR) simplifies Docker image management by providing a central location for storing and managing container images.
ACR integrates seamlessly with Azure DevOps, allowing for automated image builds and deployments.
With ACR, you can manage access and permissions for your container images, ensuring that only authorized users can access and use them.
This level of control and organization makes it easier to maintain a healthy and efficient container image pipeline.
What is Azure Container Registry?
Azure Container Registry is a service for storing and managing images and artifacts, based on Docker Registry technology.
It's vendor-agnostic, supporting OCI distribution, which enables the storage, sharing, and protection of artifacts and images.
Azure Container Registry has some basic concepts like namespaces, repositories, and tags that are essential for proper usage of the resource.
Namespaces and repositories are used together to create a unique identifier for your images and artifacts.
Repositories can be thought of as a container within a namespace, where you can store and manage your images and artifacts.
Creating
Creating an Azure Container Registry is a crucial step in deploying Docker images to Azure Kubernetes Services (AKS). To start, you'll need to create an Azure Container Registry (ACR) instance, which allows you to store and manage container images across all types of Azure deployments.
You can create an ACR instance using the Azure CLI, as shown in Example 4: "Creating Azure Container Registry in Azure". This involves navigating to the Azure portal, clicking on "Create a resource", and selecting "Container Registry" from the list of available resources.
Once you've created your ACR instance, you'll need to configure it by enabling the Admin user and obtaining the Username and passwords, which you can use to login to ACR via the docker login command.
To authenticate with the ACR, you'll use the az acr login command, as demonstrated in Example 5: "Pushing Docker Image to ACR". This command performs the authentication (login) to the Azure Container Registry (acr).
Here's a quick summary of the steps involved in creating an ACR instance and authenticating with it:
- Create an ACR instance using the Azure CLI
- Configure the ACR by enabling the Admin user and obtaining the Username and passwords
- Authenticate with the ACR using the az acr login command
By following these steps, you'll be able to create a secure and reliable container registry for your Azure Kubernetes Services (AKS) cluster.
Provisioning and Management
Provisioning Azure Container Registry is a straightforward process that can be done through the Azure Portal or Azure CLI.
To provision a new Azure Container Registry account via the Azure Portal, you'll need to create a new resource group, select the subscription, and choose the availability zones for high availability.
The Azure Portal also allows you to create a new resource group if you don't have one already, and you can access the new registry by clicking on Repositories from the sidebar menu.
Once authenticated and with the subscription set, provisioning a new Azure Container Registry resource via Azure CLI is as simple as running a few commands, including az login, az account set, and az acr create.
The az acr create command requires specifying the resource group, name, and service tier, which can be done using the -g, -n, and --sku arguments, respectively.
Each Azure Container Registry resource has a unique URL for managing artifacts, which can be found on the resource's page and labeled as the Login server.
Provisioning via the Portal
To provision an Azure Container Registry via the Azure Portal, start by opening the Azure Portal and searching for Azure Container Registry in the search bar. Select it from the results.
Subscription and Resource Group
The subscription and resource group are essential for provisioning the new service. The subscription is the name of the subscription that will be used for provisioning, and the resource group is the name of the resource group to be used, which is associated with the subscription.
Availability Zones
When selected, Availability Zones offer high availability and resilience for all registries. This is a significant feature to consider when provisioning your Azure Container Registry.
Creating the Resource
To create the resource, click on Review + Create, and after the resource manager validates the information, click on Create. This will initiate the provisioning of the new Azure Container Registry account.
Accessing the Registry
Once the provisioning is complete, access the registry and select Repositories from the sidebar menu. Within the Repositories option is where images are stored, but since we just created the resource, the repository is empty.
Here's a summary of the steps to create a new Azure Container Registry resource via the Azure Portal:
Rest Api
With Azure Monitor's REST API, you can get information about Azure Container Registry metrics programmatically. This means you can automate tasks and make decisions based on data.
You can use the REST API to list metric definitions and dimensions, which is a crucial step in understanding what data is available. This helps you tailor your queries to get the exact information you need.
To list metric definitions and dimensions, you can use the Azure Monitor REST API's built-in functionality. This is a powerful tool for developers and administrators alike.
Here are some specific actions you can take with the REST API:
- List metric definitions and dimensions
- Retrieve metric values
By using the REST API to retrieve metric values, you can gain a deeper understanding of your Azure Container Registry's performance and usage. This information can help you identify areas for improvement and make data-driven decisions.
Alert Rules
Alert rules are a crucial part of Azure Container Registry, allowing you to set up notifications for specific events or metrics. You can set alerts for any metric, log entry, or activity log entry listed in the Azure Container Registry monitoring data reference.
To get started, consider the following alert rules: Alerts if the registry storage used exceeds a specified value. This is achieved by setting the Signal to Storage used, Operator to Greater than, Aggregation type to Average, and Threshold value to 5 GB.
You can also set up alerts for other metrics, such as log entries or activity log entries. The possibilities are endless, and it's up to you to decide what works best for your container registry.
Viewing and Monitoring
Azure Container Registry collects monitoring data, just like other Azure resources. This data includes metrics and logs that can be used to understand how your registry is performing.
You can view this data in the Azure Monitor menu, under the "Metrics" option, where you can analyze metrics for your registry alongside metrics from other Azure services. This is done using the metrics explorer tool.
To access the metrics explorer, navigate to your registry in the portal and select "Metrics" under the "Monitoring" menu. Alternatively, you can create registry diagnostic settings by navigating to your registry in the portal and selecting "Diagnostic settings" under "Monitoring".
Viewing the Image
To view the image you've stored in Azure Container Registry, head back to the Azure Portal and select the Azure Container Registry resource you provisioned.
After selecting the registry, navigate to the sidebar menu and choose Repositories.
This is where you can see your image stored in the service and view the different available versions.

With Azure Container Registry, your image is stored and available for use in any process.
You can create and upload an image using Azure CLI, and then view it in the Azure Portal.
To view the image, select the Azure Container Registry resource, then choose Repositories in the sidebar menu.
Monitoring Data
You can collect monitoring data for your Azure Container Registry, which is similar to other Azure resources. This data is available in the Monitoring data from Azure resources section.
Azure Container Registry collects metrics and logs, which you can find in the Monitoring Azure Container Registry data reference. You can also view these metrics and logs by navigating to your registry in the portal and selecting Diagnostic settings under Monitoring.
To view your registry's metrics, go to the Azure Monitor menu and select Metrics. You can also access metrics explorer by navigating to your registry in the portal and selecting Metrics under Monitoring.
Azure Container Registry collects platform metrics, which you can find in the Monitoring Azure Container Registry data reference metrics. There are many tools available for analyzing monitoring data, so you can choose the one that best suits your needs.
Frequently Asked Questions
How do I navigate to Azure Container Registry?
To navigate to Azure Container Registry, sign in to the Azure portal and select the registry where your Nginx image is stored. From there, you can view and manage your repository and image tags.
Sources
- https://purple.telstra.com.au/blog/how-to-deploy-docker-images-to-azure-kubernetes-services-aks
- https://dev.to/reniciuspagotto/azure-container-registry-storing-images-and-artifacts-52af
- https://learn.microsoft.com/en-us/azure/container-registry/monitor-container-registry
- https://midnightprogrammer.net/post/how-to-create-and-push-your-docker-images-to-azure-container-registry/
- https://docs.zenml.io/stack-components/container-registries/azure
Featured Images: pexels.com