You are deploying a multi-container group to Azure Container Instances (ACI) using a YAML manifest. The application container needs to pull a private image from an Azure Container Registry (ACR) named `myregistry.azurecr.io`.
The manifest contains the following snippet:
yaml
identity:
type: SystemAssigned
imageRegistryCredentials:
- server: myregistry.azurecr.io
identity: system
When you run `az container create`, the deployment fails with an image pull authentication error.
Which configuration change must you implement in the YAML manifest to resolve the issue?
- AKeep the identity type as SystemAssigned, change the identity property under imageRegistryCredentials to SystemAssigned, and grant the container group's service principal the AcrPull role.
- BRetrieve the registry credentials from Azure Key Vault by using Key Vault references in the imageRegistryCredentials section, and grant the system-assigned identity access to the Key Vault.
- Configure a user-assigned managed identity in the YAML manifest, assign it to the container group, and set the identity property under imageRegistryCredentials to the resource ID of the user-assigned identity.Cevap
- DOmit the imageRegistryCredentials block from the YAML manifest, and configure the container group to rely on default Azure Active Directory authentication using the system-assigned identity.
Cevap
Configure a user-assigned managed identity in the YAML manifest, assign it to the container group, and set the identity property under imageRegistryCredentials to the resource ID of the user-assigned identity.
To pull an image from a private Azure Container Registry using a managed identity, you must use a user-assigned managed identity. System-assigned managed identities cannot be used for this purpose because the identity is created and assigned only after the container group is deployed, which occurs after the image pull phase. Specifying the user-assigned identity's resource ID in both the identity block and the imageRegistryCredentials section allows the ACI service to authenticate to the registry during the deployment process.
Adım Adım Çözüm
Anahtar Kavram
Authenticating ACI to private ACR using Managed Identities