You are configuring a new Azure Container App to pull container images from a private Azure Container Registry (ACR). You need to configure a managed identity to authenticate the Container App to the registry. The identity's lifecycle must be managed independently of the Container App resource, and you must follow the principle of least privilege. Which managed identity type and role-based access control (RBAC) role should you use?
- AA system-assigned managed identity with the AcrPull role
- BA user-assigned managed identity with the AcrPush role
- A user-assigned managed identity with the AcrPull roleAnswer
- DA system-assigned managed identity with the Owner role
Answer
A user-assigned managed identity with the AcrPull role
To pull container images from a private Azure Container Registry (ACR), the Azure Container App needs a managed identity that has the AcrPull RBAC role assigned on the ACR. Since the lifecycle of the identity needs to be managed independently of the Container App resource itself (meaning the identity persists even if the Container App is deleted and can be shared among other resources), a user-assigned managed identity must be selected.
Step-by-Step Solution
Key Concept
Configuring Azure Container App registry authentication using a user-assigned managed identity and Azure RBAC roles.
Estimated Time:45s