title | description | services | author | ms.service | ms.topic | ms.date | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|
include file |
include file |
container-instances |
dlepow |
container-instances |
include |
08/13/2020 |
danlep |
include file, devx-track-azurecli |
Before you create your container registry, you need a resource group to deploy it to. A resource group is a logical collection into which all Azure resources are deployed and managed.
Create a resource group with the az group create command. In the following example, a resource group named myResourceGroup is created in the eastus region:
az group create --name myResourceGroup --location eastus
Once you've created the resource group, create an Azure container registry with the az acr create command. The container registry name must be unique within Azure, and contain 5-50 alphanumeric characters. Replace <acrName>
with a unique name for your registry:
az acr create --resource-group myResourceGroup --name <acrName> --sku Basic
Here's partial output for a new Azure container registry named mycontainerregistry082:
{
"creationDate": "2020-07-16T21:54:47.297875+00:00",
"id": "/subscriptions/<Subscription ID>/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/mycontainerregistry082",
"location": "eastus",
"loginServer": "mycontainerregistry082.azurecr.io",
"name": "mycontainerregistry082",
"provisioningState": "Succeeded",
"resourceGroup": "myResourceGroup",
"sku": {
"name": "Basic",
"tier": "Basic"
},
"status": null,
"storageAccount": null,
"tags": {},
"type": "Microsoft.ContainerRegistry/registries"
}
The rest of the tutorial refers to <acrName>
as a placeholder for the container registry name that you chose in this step.
You must log in to your Azure Container Registry instance before pushing images to it. Use the az acr login command to complete the operation. You must provide the unique name you chose for the container registry when you created it.
az acr login --name <acrName>
For example:
az acr login --name mycontainerregistry082
The command returns Login Succeeded
once completed:
Login Succeeded