You are deploying a containerized microservice named `orders-api` to Azure Container Apps by using a Bicep template. The container image is stored in a private Azure Container Registry (ACR) named `myregistry.azurecr.io`. You configure a system-assigned managed identity on the Container App and assign it the `AcrPull` role on the registry.
How should you configure the registry credentials in the Bicep template to ensure the Container App can pull the image from the private registry using the system-assigned managed identity?
- ASet the `identity` property to the principal ID of the system-assigned managed identity of the Container App.
- Set the `identity` property to `'system'` in the registry configuration block under the registries array.Cevap
- CSet the `identity` property to the resource ID of the Container App itself.
- DConfigure a startup command in the Container App to run `az acr login` using the registry credentials.
Cevap
To pull the image using a system-assigned managed identity, set the identity property to 'system' in the registry configuration block under the registries array.
The correct answer is to set the identity property to 'system' in the registry configuration block under the registries array. For system-assigned managed identity authentication to a private registry, Azure Container Apps requires the identity property of the registry object to be set to the string literal 'system'.
Adım Adım Çözüm
Anahtar Kavram
Registry authentication using system-assigned managed identity in Azure Container Apps