az acr task credential

Manage credentials for a task. Please see https://aka.ms/acr/tasks/cross-registry-authentication for more information.

Commands

az acr task credential add Add a custom registry login credential to the task.
az acr task credential list List all the custom registry credentials for task.
az acr task credential remove Remove credential for a task.
az acr task credential update Update the registry login credential for a task.

az acr task credential add

Add a custom registry login credential to the task.

az acr task credential add --login-server
--name
--registry
[--password]
[--resource-group]
[--subscription]
[--use-identity]
[--username]

Examples

Add a registry login credential to a task using a plain text username and password.

az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \
    -u 'myusername' -p 'mysecret'

Add a registry login credential to a task using key vault secret URIs for the username and password and the task system-assigned identity.

az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \
    -u 'https://mykeyvault.vault.azure.net/secrets/secretusername' -p 'https://mykeyvault.vault.azure.net/secrets/secretpassword' \
    --use-identity [system]

Add a registry login credential to a task using key vault secret URIs for the username and password and a task user-assigned identity given by its client id.

az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \
    -u 'https://mykeyvault.vault.azure.net/secrets/secretusername' -p 'https://mykeyvault.vault.azure.net/secrets/secretpassword' \
    --use-identity 00000000-0000-0000-0000-000000000000

Add a registry login credential to a task using a plain text username and key vault secret URI for the password and the task user-assigned identity given by its client id.

az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \
    -u 'myusername' -p 'https://mykeyvault.vault.azure.net/secrets/secretpassword' \
    --use-identity 00000000-0000-0000-0000-000000000000

Add a registry login credential to a task using a plain text username and key vault secret URI for the password and the default managed identity for the task if one exists.

az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \
    -u 'myusername' -p 'https://mykeyvault.vault.azure.net/secrets/secretpassword'

Add a registry login credential to a task that uses only the task system-assigned identity to authenticate to the registry.

az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \
    --use-identity [system]

Required Parameters

--login-server

The login server of the custom registry. For instance, 'myregistry.azurecr.io'.

--name -n

The name of the task.

--registry -r

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 to login to the custom registry. This can be plain text or a key vault secret URI.

--resource-group -g

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--use-identity

The task managed identity used for the credential. Use '[system]' to refer to the system-assigned identity or a client id to refer to a user-assigned identity. Please see https://aka.ms/acr/tasks/cross-registry-authentication for more information.

--username -u

The username to login to the custom registry. This can be plain text or a key vault secret URI.

az acr task credential list

List all the custom registry credentials for task.

az acr task credential list --name
--registry
[--resource-group]
[--subscription]

Examples

List the Credentials for a task.

az acr task credential list -n taskname -r registryname

Required Parameters

--name -n

The name of the task.

--registry -r

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az acr task credential remove

Remove credential for a task.

az acr task credential remove --login-server
--name
--registry
[--resource-group]
[--subscription]

Examples

Remove a registry login credential from a task.

az acr task credential remove -n taskname -r registryname --login-server myregistry.docker.io

Required Parameters

--login-server

The login server of the custom registry. For instance, 'myregistry.azurecr.io'.

--name -n

The name of the task.

--registry -r

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az acr task credential update

Update the registry login credential for a task.

az acr task credential update --login-server
--name
--registry
[--password]
[--resource-group]
[--subscription]
[--use-identity]
[--username]

Examples

Update the credential for a task

az acr task credential update -n taskname -r registryname --login-server myregistry.docker.io \
    -u 'myusername2' -p 'mysecret'

Required Parameters

--login-server

The login server of the custom registry. For instance, 'myregistry.azurecr.io'.

--name -n

The name of the task.

--registry -r

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 to login to the custom registry. This can be plain text or a key vault secret URI.

--resource-group -g

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

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--use-identity

The task managed identity used for the credential. Use '[system]' to refer to the system-assigned identity or a client id to refer to a user-assigned identity. Please see https://aka.ms/acr/tasks/cross-registry-authentication for more information.

--username -u

The username to login to the custom registry. This can be plain text or a key vault secret URI.