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