CmdID

CmdID / az / az acr / az acr task / az acr task identity

az acr task identity assign

Update the managed identity for a task. Azure CLI reference

3 examples Its page in the Azure CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from the Azure CLI, each command read by CmdID

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 myregistryIdentify
-nThe name of the task.
-rName of registry.

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"Identify
-nThe name of the task.
-rName of registry.
--identitiesAssign managed identities to the task.

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"Identify
-nThe name of the task.
-rName of registry.
--identitiesAssign managed identities to the task.