az acr

Manage private registries with Azure Container Registries.

Commands

az acr build Queues a quick build, providing streamed logs for an Azure Container Registry.
az acr build-task Manage build definitions, which can be triggered by git commits or base image updates for OS & Framework Patching.
az acr build-task create Creates a new build definition which can be triggered by git commits or base image updates for an Azure Container Registry.
az acr build-task delete Delete a build task from an Azure Container Registry.
az acr build-task list List the build tasks for an Azure Container Registry.
az acr build-task list-builds List all of the executed builds for an Azure Container Registry.
az acr build-task logs Show logs for a particular build. If no build-id is supplied, display the logs for the last created build.
az acr build-task run Trigger a build task that might otherwise be waiting for git commits or base image update triggers for an Azure Container Registry.
az acr build-task show Get the properties of a specified build task for an Azure Container Registry.
az acr build-task show-build Get the properties of a specified build for an Azure Container Registry.
az acr build-task update Update a build task for an Azure Container Registry.
az acr build-task update-build Patch the build properties of an Azure Container Registry.
az acr check-name Checks if an Azure Container Registry name is valid and available for use.
az acr config Configure policies for Azure Container Registries.
az acr config content-trust Manage content-trust policy for Azure Container Registries.
az acr config content-trust show Show the configured content-trust policy for an Azure Container Registry.
az acr config content-trust update Update content-trust policy for an Azure Container Registry.
az acr create Creates an Azure Container Registry.
az acr credential Manage login credentials for Azure Container Registries.
az acr credential renew Regenerate login credentials for an Azure Container Registry.
az acr credential show Get the login credentials for an Azure Container Registry.
az acr delete Deletes an Azure Container Registry.
az acr helm Manage helm charts for Azure Container Registries.
az acr helm delete Delete a helm chart version in an Azure Container Registry.
az acr helm list List all helm charts in an Azure Container Registry.
az acr helm push Push a helm chart package to an Azure Container Registry.
az acr helm repo Manage helm chart repositories for Azure Container Registries.
az acr helm repo add Add a helm chart repository from an Azure Container Registry through the Helm CLI.
az acr helm show Describe a helm chart in an Azure Container Registry.
az acr import Imports an image to an Azure Container Registry from another Container Registry. Import removes the need to docker pull, docker tag, docker push.
az acr list Lists all the container registries under the current subscription.
az acr login Log in to an Azure Container Registry through the Docker CLI.
az acr replication Manage geo-replicated regions of Azure Container Registries.
az acr replication create Create a replicated region for an Azure Container Registry.
az acr replication delete Delete a replicated region from an Azure Container Registry.
az acr replication list List all of the regions for a geo-replicated Azure Container Registry.
az acr replication show Get the details of a replicated region.
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 an Azure Container Registry.
az acr repository list List repositories in an Azure Container Registry.
az acr repository show Get the attributes of a repository or image in an Azure Container Registry.
az acr repository show-manifests Show manifests of a repository in an Azure Container Registry.
az acr repository show-tags Show tags for a repository in an Azure Container Registry.
az acr repository untag Untag an image in an Azure Container Registry.
az acr repository update Update the attributes of a repository or image in an Azure Container Registry.
az acr run Queues a quick run providing streamed logs for an Azure Container Registry.
az acr show Get the details of an Azure Container Registry.
az acr show-usage Get the storage usage for an Azure Container Registry.
az acr task Manage a collection of steps for building, testing and OS & Framework patching container images using Azure Container Registries.
az acr task cancel-run Cancel a specified run of an Azure Container Registry.
az acr task create Creates a series of steps for building, testing and OS & Framework patching containers. Tasks support triggers from git commits and base image updates.
az acr task delete Delete a task from an Azure Container Registry.
az acr task list List the tasks for an Azure Container Registry.
az acr task list-runs List all of the executed runs for an Azure Container Registry, with the ability to filter by a specific Task.
az acr task logs Show logs for a particular run. If no run-id is supplied, show logs for the last created run.
az acr task run Manually trigger a task that might otherwise be waiting for git commits or base image update triggers.
az acr task show Get the properties of a named task for an Azure Container Registry.
az acr task show-run Get the properties of a specified run of an Azure Container Registry Task.
az acr task update Update a task for an Azure Container Registry.
az acr task update-run Patch the run properties of an Azure Container Registry Task.
az acr update Update an Azure Container Registry.
az acr webhook Manage webhooks for Azure Container Registries.
az acr webhook create Create a webhook for an Azure Container Registry.
az acr webhook delete Delete a webhook from an Azure 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 an Azure 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 build, providing streamed logs for an Azure Container Registry.

az acr build --registry
[--build-arg]
[--file]
[--image]
[--no-format]
[--no-logs]
[--no-push]
[--os {Linux, Windows}]
[--resource-group]
[--secret-build-arg]
[--timeout]
[]

Examples

Queue a local context (folder), pushed to ACR when complete, with streaming logs.

az acr build -t sample/hello-world:{{.Run.ID}} -r MyRegistry .

Queue a local context, pushed to ACR without streaming logs.

az acr build -t sample/hello-world:{{.Run.ID}} -r MyRegistry --no-logs .

Queue a local context to validate a build is successful, without pushing to the registry using the --no-push parameter.

az acr build -t sample/hello-world:{{.Run.ID}} -r MyRegistry --no-push .

Queue a local context to validate a build is successful, without pushing to the registry. Removing the -t parameter defaults to --no-push

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.

--image -t

The name of the image. May include a tag in the format 'name:tag'.

--no-format

Indicates whether the logs should be displayed in raw 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.

--os

The operating system type required for the build.

accepted values: Linux, Windows
default value: Linux
--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 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 an Azure 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 an Azure 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 an Azure Container Registry with a new storage account with the Classic SKU (Classic registries are being deprecated by March 2019).

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 an Azure Container Registry.

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

Examples

Delete an Azure 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 an Azure Container Registry from another Container Registry. Import removes the need to docker pull, docker tag, docker push.

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

Examples

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

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 name of the image. May include a tag in the format 'name:tag'.

--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, across multiple resource groups.

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 an Azure Container Registry through the Docker CLI.

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

Examples

Log in to an Azure 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 run

Queues a quick run providing streamed logs for an Azure Container Registry.

az acr run --registry
[--file]
[--no-format]
[--no-logs]
[--no-wait]
[--os {Linux, Windows}]
[--resource-group]
[--set]
[--timeout]
[--values]
[]

Examples

Queue a local context, pushed to ACR with streaming logs.

az acr run -r MyRegistry -f bash-echo.yaml .

Queue a remote git context with streaming logs.

az acr run -r MyRegistry https://github.com/Azure-Samples/acr-tasks.git -f hello-world.yaml

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

--file -f

The task template/definition file path relative to the source context.

default value: acb.yaml
--no-format

Indicates whether the logs should be displayed in raw format.

--no-logs

Do not show logs after successfully queuing the build.

--no-wait

Do not wait for the run to complete and return immediately after queuing the run.

--os

The operating system type required for the build.

accepted values: Linux, Windows
default value: Linux
--resource-group -g

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

--set

Value in 'name[=value]' format.

--timeout

The timeout in seconds.

--values

The task values file path relative to the source context.

<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 show

Get the details of an Azure Container Registry.

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

Examples

Get the login server for an Azure 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 storage usage for an Azure Container Registry.

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

Examples

Get the storage usage for an Azure 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 an Azure Container Registry.

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

Examples

Update tags for an Azure Container Registry.

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

Update the storage account for an Azure Container Registry (Classic Registries are being deprecated as of March 2019).

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

Enable the administrator user account for an Azure 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
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--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.