Learn how to create an Azure Container Registry(ACR) with the Azure Portal to deploy docker images.
This is Part 1 of Deploy a Python web app to Azure App Service on Linux using Docker and Azure Container Registry.
Learning Objective
This tutorial series explains how to setup an Azure Container Registry to deploy a python web app to Azure App Service with ACR for your Model Asset Exchange (MAX) model. Let’s get started!
Azure Container Registry
Azure Container Registry is a platform by Microsoft Azure to host docker container images similar to Docker Hub. It is a private space (Or Registry) where you can host and manage docker container images. These images can be pushed, pulled and run locally. It also has the ability to deploy an image to Azure App Service (Web Apps/Function Apps | PaaS by Microsoft Azure).
Azure Container Registry can be used for automated deployments using Build and release pipelines in Azure DevOPS.
Note: Click here for High level overview of Azure DEVOPS along with building LAB environment.
Prerequisites
If you are not familiar with the Model Asset Exchange, this introductory article provides a good overview.
Additionally, you need the following:
- Azure Subscription at https://azure.microsoft.com/en-us/free/
- Azure-cli, see Install Azure CLI
- Docker (to use Docker commands to push a container image into the registry, and finally pull and run the image from your registry to web app.)
Sign in to Azure
Sign in to the Azure portal at https://portal.azure.com.
Create a resource group
Its better to create resource group in Azure for grouping a collection of assets in logical groups for easy or even automatic provisioning, monitoring, and access control, and for more effective management of their costs. Let’s create a new resource group in the East US location named AZ-RG-LearnTogether-nonProd.
Select Resource groups> Add
You can find your resource group in the list of groups once it is created.
Create a container registry
Select Create a resource > Containers > Container Registry.
Fill in the Registry name and Resource group. The registry name should be unique within Azure, and for SKU, you can select ‘Basic’, ‘Standard’ or ‘Premium’. See Service Tiers for ACR.
You can automate this deployment as well by selecting ‘Automation options’.
Select Create to deploy the ACR instance.
When the message appears “Deployment succeeded”, you can select the container registry in the portal.
Please note the value of Login server. You will use this value in the next steps while working with your registry with the Azure CLI and Docker.
Conclusion: Putting everything together
In this tutorial, we created a Resource group and an Azure Container Registry with the Azure portal.
Next….
- Part 2, we will build, run, create and push an image of Python Web app to Azure Container Registry.
- Part 3, we will deploy a containerized web app to Azure app service.
Thank you for reading!