Share via


az acr task identity

Managed Identities for Task. Please see https://aka.ms/acr/tasks/task-create-managed-identity for more information.

Commands

Name Description Type Status
az acr task identity assign

Update the managed identity for a task.

Core GA
az acr task identity remove

Remove managed identities for a task.

Core GA
az acr task identity show

Display the managed identities for task.

Core GA

az acr task identity assign

Update the managed identity for a task.

az acr task identity assign --name
                            --registry
                            [--identities]
                            [--resource-group]

Examples

Enable the system-assigned identity on an existing task. This will replace all existing user-assigned identities for that task.

az acr task identity assign -n MyTask -r myregistry

Assign user-assigned managed identities to an existing task. This will remove the existing system-assigned identity.

az acr task identity assign -n MyTask -r myregistry \
    --identities "/subscriptions/<SUBSCRIPTON ID>/resourcegroups/<RESOURCE GROUP>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentitiy"

Assign both system-assigned and user-assigned managed identities to an existing task.

az acr task identity assign -n MyTask -r myregistry \
    --identities [system] "/subscriptions/<SUBSCRIPTON ID>/resourcegroups/<RESOURCE GROUP>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentitiy"

Required Parameters

--name -n

The name of the task.

--registry -r

The name of the container registry. It should be specified in lower case. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--identities

Assigns managed identities to the task. Use '[system]' to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az acr task identity remove

Remove managed identities for a task.

az acr task identity remove --name
                            --registry
                            [--identities]
                            [--resource-group]

Examples

Remove the system-assigned identity from a task.

az acr task identity remove -n MyTask -r myregistry

Remove a user-assigned identity from a task.

az acr task identity remove -n MyTask -r myregistry \
    --identities "/subscriptions/<SUBSCRIPTON ID>/resourcegroups/<RESOURCE GROUP>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentitiy"

Remove all managed identities from a task.

az acr task identity remove -n MyTask -r myregistry --identities [all]

Required Parameters

--name -n

The name of the task.

--registry -r

The name of the container registry. It should be specified in lower case. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--identities

Assigns managed identities to the task. Use '[system]' to refer to the system-assigned identity or a resource ID to refer to a user-assigned identity.

--resource-group -g

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az acr task identity show

Display the managed identities for task.

az acr task identity show --name
                          --registry
                          [--resource-group]

Examples

Display the managed identities for a task.

az acr task identity show -n MyTask -r myregistry

Required Parameters

--name -n

The name of the task.

--registry -r

The name of the container registry. It should be specified in lower case. 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>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.