A developer needs to host a backend service named `payment-worker` on Azure Container Apps. The container image is stored in a private Azure Container Registry (ACR) named `payreg.azurecr.io`. To secure the deployment, the developer wants to avoid hardcoding registry credentials and instead use a managed identity to authenticate the image pull. The solution must support the initial deployment creation of the Container App. Which identity type must be configured for the container app to authenticate the registry pull, and what is the minimum required Azure role-based access control (RBAC) role that must be assigned to the identity on the ACR?
- AA system-assigned managed identity, with the AcrPull role assigned to the identity on the Azure Container Registry.
- BA user-assigned managed identity, with the AcrPush role assigned to the identity on the Azure Container Registry.
- A user-assigned managed identity, with the AcrPull role assigned to the identity on the Azure Container Registry.Answer
- DA system-assigned managed identity, with the Reader role assigned to the identity on the Azure Container Registry.
Answer
A user-assigned managed identity, with the AcrPull role assigned to the identity on the Azure Container Registry.
For the initial creation and deployment of an Azure Container App that pulls an image from a private Azure Container Registry (ACR), a user-assigned managed identity must be used. Since a system-assigned managed identity is only created after the container app resource itself has been provisioned, it is not available to authenticate the initial image pull. Furthermore, the identity requires the AcrPull role on the ACR to read and download the container image.
Step-by-Step Solution
Key Concept
Configuring private registry authentication for Azure Container Apps using managed identities