az acr task identity

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

Commands

az acr task identity assign

Update the managed identity for a task.

az acr task identity remove

Remove managed identities for a task.

az acr task identity show

Display the managed identities for task.

az acr task identity assign

Update the managed identity for a task.

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

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

--subscription

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

az acr task identity remove

Remove managed identities for a task.

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

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

--subscription

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

az acr task identity show

Display the managed identities for task.

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

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. You can configure the default registry name using az configure --defaults acr=<registry name>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

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