az acr task identity

Managed Service Identities for Task.

Commands

az acr task identity assign Update the managed service identity for a task.
az acr task identity remove Remove managed service identities for a task.
az acr task identity show Display the managed service identities for task.

az acr task identity assign

Update the managed service 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 service 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 service identities for task.

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

Examples

Display the managed service 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

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