You are building a scheduled batch processing application that runs as an Azure Container Instances (ACI) container group. The container image is hosted in a private Azure Container Registry (ACR). The batch application processes sensitive medical records and must retrieve an encryption key stored in Azure Key Vault at startup. You need to configure the ACI container group so that it can pull the image from the private ACR and authenticate to the Key Vault to retrieve the encryption key using the minimum level of privileges. Which configuration should you implement?
- AAssign a system-assigned managed identity to the container group, assign the AcrPull role to this identity for the ACR resource, and grant the identity GET permissions in the Key Vault access policies.
- Assign a user-assigned managed identity to the container group, assign the AcrPull role to this identity for the ACR resource, and grant the identity GET permissions in the Key Vault access policies.Cevap
- CAssign a user-assigned managed identity to the container group, assign the AcrPull role to this identity for the ACR resource, and enable Key Vault firewall bypass for trusted Microsoft services without defining access policies.
- DAssign a user-assigned managed identity to the container group, grant the identity GET permissions in the Key Vault access policies, and configure the container startup command to run 'az acr login' to authenticate the registry pull.
Cevap
Assign a user-assigned managed identity to the container group, assign the AcrPull role to this identity for the ACR resource, and grant the identity GET permissions in the Key Vault access policies.
The correct configuration uses a user-assigned managed identity. Because ACI needs to pull the container image from a private registry before the container group itself is fully created, a system-assigned identity cannot be used for registry authentication. Assigning the AcrPull role to the user-assigned identity allows ACI to pull the image, and granting GET permissions to the same identity in the Key Vault access policies ensures the application can retrieve secrets at runtime.
Adım Adım Çözüm
Anahtar Kavram
Authentication and authorization configuration for Azure Container Instances pulling from private Azure Container Registry and accessing Azure Key Vault using managed identities.