You are deploying a containerized service to Azure Container Instances (ACI) that must pull its image from a private Azure Container Registry (ACR). Once running, the application inside the container must retrieve an API key from Azure Key Vault. You want to use a single managed identity to authenticate both the image pull from ACR and the secret retrieval from Key Vault. Which configuration should you use?
- AConfigure a system-assigned managed identity, assign it the AcrPull role on the ACR, grant it Get secrets permission on the Key Vault, and configure the container group to use this identity for the image pull.
- BConfigure a user-assigned managed identity, assign it the AcrPull role on the ACR, configure the container group to use this identity for the image pull, and run the container with default settings without assigning additional permissions for Key Vault.
- Configure a user-assigned managed identity, assign it the AcrPull role on the ACR, grant it Get secrets permission on the Key Vault, and configure the container group to use this identity for the image pull.Cevap
- DConfigure a user-assigned managed identity, grant it Get secrets permission on the Key Vault, and configure the container's startup script to execute the Azure CLI command to authenticate to the registry before the image is pulled.
Cevap
Configure a user-assigned managed identity, assign it the AcrPull role on the ACR, grant it Get secrets permission on the Key Vault, and configure the container group to use this identity for the image pull.
A user-assigned managed identity is created independently of the container group, which allows it to be referenced in the container group's deployment configuration to authenticate the container image pull from a private Azure Container Registry. Because it is assigned to the container group, the same identity is available to the container at runtime to authenticate to Azure Key Vault and retrieve secrets, fulfilling the requirement of using a single identity.
Adım Adım Çözüm
Anahtar Kavram
Azure Container Instances supports authenticating to a private Azure Container Registry and accessing Azure Key Vault using a user-assigned managed identity.