You are configuring a self-hosted runner on an Azure Virtual Machine to build and push container images to an Azure Container Registry (ACR) named devregistry2026. You want to use a user-assigned managed identity to authenticate the Virtual Machine runner to the registry. Which two actions should you perform?
- Assign the AcrPush role to the user-assigned managed identity.Answer
- Run the az login --identity command on the Virtual Machine.Answer
- CAssign the AcrPull role to the user-assigned managed identity.
- DAssign the AcrPush role to the Virtual Machine's system-assigned managed identity.
Answer
Assign the AcrPush role to the user-assigned managed identity and run the az login --identity command on the Virtual Machine.
To push container images to Azure Container Registry using a user-assigned managed identity, you must assign the AcrPush role to the identity to grant the necessary write permissions. Additionally, you must run the az login --identity command to authenticate the CLI context on the Virtual Machine using the associated managed identity.
Step-by-Step Solution
Key Concept
Azure Container Registry authentication using user-assigned managed identities and Azure RBAC roles.