az acr

Manage Azure Container Registries for private registries within Azure.

Commands

az acr build Queues a quick docker build providing interactive feedback.
az acr build-task Manage build definitions, which can be triggered by git commits or base image updates.
az acr build-task create Creates a new build definition which can be triggered by git commits or base image updates.
az acr build-task delete Delete a build task from a container registry.
az acr build-task list List the build tasks for a container registry.
az acr build-task list-builds List all of the executed builds for a registry, with the ability to filter by a specific build task.
az acr build-task logs Show logs for a particular build. If no build-id is supplied, it shows logs for the last updated build.
az acr build-task run Trigger a build task that might otherwise be waiting for git commits or base image update triggers.
az acr build-task show Get the properties of a specified build task.
az acr build-task show-build Get the properties of a specified build.
az acr build-task update Update a build task for a container registry.
az acr check-name Checks if a container registry name is valid and available for use.
az acr create Creates a container registry.
az acr credential Manage login credentials for Azure Container Registries.
az acr credential renew Regenerate login credentials for a container registry.
az acr credential show Get the login credentials for a container registry.
az acr delete Deletes a container registry.
az acr import Imports an image to the container registry from source.
az acr list Lists all the container registries under the current subscription.
az acr login Log in to a container registry through the Docker CLI.
az acr replication Manage replications of Azure Container Registries across multiple regions.
az acr replication create Create a replication for a container registry.
az acr replication delete Delete a replication from a container registry.
az acr replication list List all of the replications for a container registry.
az acr replication show Get the details of a replication.
az acr replication update Updates a replication.
az acr repository Manage repositories (image names) for Azure Container Registries.
az acr repository delete Delete a repository or image in a container registry.
az acr repository list List repositories in a container registry.
az acr repository show-manifests Show manifests of a repository in a container registry.
az acr repository show-tags Show tags for a repository in a container registry.
az acr repository untag Untag an image in a container registry.
az acr show Get the details of a container registry.
az acr show-usage Get the quota usages for a container registry.
az acr update Update a container registry.
az acr webhook Manage webhooks for Azure Container Registries.
az acr webhook create Create a webhook for a container registry.
az acr webhook delete Delete a webhook from a container registry.
az acr webhook get-config Get the service URI and custom headers for the webhook.
az acr webhook list List all of the webhooks for a container registry.
az acr webhook list-events List recent events for a webhook.
az acr webhook ping Trigger a ping event for a webhook.
az acr webhook show Get the details of a webhook.
az acr webhook update Update a webhook.

az acr build

Queues a quick docker build providing interactive feedback.

az acr build --registry
[--build-arg]
[--file]
[--image]
[--no-logs]
[--no-push {false, true}]
[--resource-group]
[--secret-build-arg]
[--timeout]
[]

Examples

Queue a local context, validating the build is successful, without pushing to the registry.

az acr build -r MyRegistry .

Required Parameters

--registry -r

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--build-arg

Build argument in 'name[=value]' format.

--file -f

The relative path of the the docker file to the source code root folder.

default value: Dockerfile
--image -t

The image repository and optionally a tag in the 'repository:tag' format.

--no-logs

Do not show logs after successfully queuing the build.

--no-push

Indicates whether the image built should be pushed to the registry.

accepted values: false, true
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--secret-build-arg

Secret build argument in 'name[=value]' format.

--timeout

The build timeout in seconds.

<SOURCE_LOCATION>

The local source code directory path (e.g., './src') or the URL to a git repository (e.g., 'https://github.com/Azure-Samples/acr-build-helloworld-node.git') or a remote tarball (e.g., 'http://server/context.tar.gz').

az acr check-name

Checks if a container registry name is valid and available for use.

az acr check-name --name

Examples

Check if a registry name already exists.

az acr check-name -n doesthisnameexist

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

az acr create

Creates a container registry.

az acr create --name
--resource-group
--sku {Basic, Classic, Premium, Standard}
[--admin-enabled {false, true}]
[--location]
[--storage-account-name]

Examples

Create a managed container registry with the Standard SKU.

az acr create -n MyRegistry -g MyResourceGroup --sku Standard

Create a container registry with a new storage account with the Classic SKU.

az acr create -n MyRegistry -g MyResourceGroup --sku Classic

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--sku

The SKU of the container registry.

accepted values: Basic, Classic, Premium, Standard

Optional Parameters

--admin-enabled

Indicates whether the admin user is enabled.

accepted values: false, true
--location -l

Location. You can configure the default location using az configure --defaults location=<location>.

--storage-account-name

Provide the name of an existing storage account if you're recreating a container registry over a previous registry created storage account. Only applicable to Classic SKU.

az acr delete

Deletes a container registry.

az acr delete --name
[--resource-group]

Examples

Delete a container registry.

az acr delete -n MyRegistry

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az acr import

Imports an image to the container registry from source.

az acr import --name
--source
[--force]
[--image]
[--registry]
[--repository]
[--resource-group]

Examples

Import an image to the target registry and inherits sourcerepository:sourcetag from source.

az acr import -n MyRegistry --source sourceregistry.azurecr.io/sourcerepository:sourcetag

Import an image from a registry in a different subscription.

az acr import -n MyRegistry --source sourcerepository:sourcetag -t targetrepository:targettag -r /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

--source

The source identifier in the format '[registry.azurecr.io/]repository[:tag]' or '[registry.azurecr.io/]repository@digest'.

Optional Parameters

--force

Overwrite the existing tag of the image to be imported.

--image -t

The repository and optionally a tag in the 'repository:tag' format for target images.

--registry -r

The source container registry can be name, login server or resource ID of the source registry.

--repository

The repository name to do a manifest-only copy for images.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az acr list

Lists all the container registries under the current subscription.

az acr list [--resource-group]

Examples

List container registries and show the results in a table.

az acr list -o table

List container registries in a resource group and show the results in a table.

az acr list -g MyResourceGroup -o table

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az acr login

Log in to a container registry through the Docker CLI.

az acr login --name
[--password]
[--resource-group]
[--username]

Examples

Log in to a container registry

az acr login -n MyRegistry

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--password -p

The password used to log into a container registry.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--username -u

The username used to log into a container registry.

az acr show

Get the details of a container registry.

az acr show --name
[--resource-group]

Examples

Get the login server for a container registry.

az acr show -n MyRegistry --query loginServer

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az acr show-usage

Get the quota usages for a container registry.

az acr show-usage --name
[--resource-group]

Examples

Get the quota usages for a container registry.

az acr show-usage -n MyRegistry

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az acr update

Update a container registry.

az acr update --name
[--add]
[--admin-enabled {false, true}]
[--remove]
[--resource-group]
[--set]
[--sku {Basic, Classic, Premium, Standard}]
[--storage-account-name]
[--tags]

Examples

Update tags for a container registry.

az acr update -n MyRegistry --tags key1=value1 key2=value2

Update the storage account for a container registry.

az acr update -n MyRegistry --storage-account-name MyStorageAccount

Enable the administrator user account for a container registry.

az acr update -n MyRegistry --admin-enabled true

Required Parameters

--name -n

The name of the container registry. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--admin-enabled

Indicates whether the admin user is enabled.

accepted values: false, true
--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--sku

The SKU of the container registry.

accepted values: Basic, Classic, Premium, Standard
--storage-account-name

Provide the name of an existing storage account if you're recreating a container registry over a previous registry created storage account. Only applicable to Classic SKU.

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.