Exercise - Deploy an Azure container registry
Important
You need your own Azure subscription to complete this exercise, and you might incur charges. If you don't already have an Azure subscription, create a free account before you begin.
Create an Azure container registry
Launch Azure Cloud Shell and sign in to your Azure account. If you're using Azure CLI from your computer, use the
az logincommand and sign in to your Azure account.az loginAt the top of the Cloud Shell window, select Settings, then select Go to Classic version. The classic version is needed later in this module to use Docker commands.
Verify that the
Microsoft.ContainerRegistryandMicrosoft.ContainerInstanceresource providers are registered in your subscription using theaz provider showcommand.az provider show --namespace Microsoft.ContainerRegistry --output tableNamespace RegistrationPolicy RegistrationState --------------------------- -------------------- ------------------- Microsoft.ContainerRegistry RegistrationRequired NotRegisteredRun the following command to register the resource provider if the
RegistrationStateisNotRegistered.az provider register --namespace Microsoft.ContainerRegistryCreate a resource group named learn-acr-rg to hold the resources for this module using the
az group createcommand.az group create --name learn-acr-rg --location eastusDefine an environment variable, ACR_NAME, to hold your container registry name using the following command. Replace
<your-unique-acr-name>with your container registry name.The container registry name must be unique within Azure and contain 5-50 alphanumeric characters. For more information, see Define your naming convention.
ACR_NAME=<your-unique-acr-name>Create an Azure container registry using the
az acr createcommand.az acr create --resource-group learn-acr-rg --name $ACR_NAME --sku PremiumIn this example, we deploy a premium registry SKU required for geo-replication.