You are configuring a new Azure Container App named shipping-tracker to host a containerized microservice. The container image is stored in a private Azure Container Registry (ACR) named shippingregistry.azurecr.io. You need to configure the Container App to securely pull the image from the registry without enabling the ACR admin user or using static credentials.
Which configuration should you apply to meet these requirements?
- Assign a user-assigned managed identity to the Container App, grant that identity the AcrPull role on the Azure Container Registry, and configure the Container App's registry settings to reference the user-assigned identity.Cevap
- BEnable a system-assigned managed identity on the Container App, grant that identity the AcrPull role on the Azure Container Registry, and configure the Container App's registry settings to reference the system-assigned identity.
- CConfigure a startup script within the Container App that runs the 'az acr login' command to authenticate the Container Apps environment to the registry prior to provisioning the container.
- DAssign a system-assigned managed identity to the Container Apps environment, grant that identity the Owner role on the Azure Container Registry, and configure the container to authenticate using the environment's default credential provider.
Cevap
The correct configuration is to assign a user-assigned managed identity to the Container App, grant that identity the AcrPull role on the Azure Container Registry, and configure the Container App's registry settings to reference the user-assigned identity.
To securely pull an image from a private Azure Container Registry without using admin credentials, you must use a user-assigned managed identity. The identity is granted the AcrPull role on the registry, and its resource ID is referenced in the container app's registry configuration. This allows the Container App to authenticate and pull the image during provisioning.
Adım Adım Çözüm
Anahtar Kavram
Configuring Azure Container App registry authentication using user-assigned managed identities for secure image pulls from a private Azure Container Registry.