title | description | services | author | ms.service | ms.topic | ms.date | ms.author | ms.custom |
---|---|---|---|---|---|---|---|---|
include file |
include file |
container-registry |
dlepow |
container-registry |
include |
07/12/2019 |
danlep |
include file, devx-track-azurecli |
Create an identity named myACRTasksId in your subscription using the az identity create command. You can use the same resource group you used previously to create a container registry, or a different one.
az identity create \
--resource-group myResourceGroup \
--name myACRTasksId
To configure the user-assigned identity in the following steps, use the az identity show command to store the identity's resource ID, principal ID, and client ID in variables.
# Get resource ID of the user-assigned identity
resourceID=$(az identity show \
--resource-group myResourceGroup \
--name myACRTasksId \
--query id --output tsv)
# Get principal ID of the task's user-assigned identity
principalID=$(az identity show \
--resource-group myResourceGroup \
--name myACRTasksId \
--query principalId --output tsv)
# Get client ID of the user-assigned identity
clientID=$(az identity show \
--resource-group myResourceGroup \
--name myACRTasksId \
--query clientId --output tsv)