You are deploying a multi-container group to Azure Container Instances (ACI) using a YAML deployment file. The deployment consists of an application container and a logging sidecar container. The container images are hosted in a private Azure Container Registry (ACR). The application requires persistent storage provided by an Azure File share, and must authenticate to ACR using a user-assigned managed identity to avoid storing credentials in the YAML file. Which two of the following configuration blocks must you include in the YAML deployment definition to satisfy these requirements? (Select two.)
- An 'identity' block at the container group root level with type 'UserAssigned' containing the managed identity's resource ID, and an 'imageRegistryCredentials' block specifying the ACR server and the identity's resource ID.Cevap
- A 'volumes' block at the container group root level specifying the 'azureFile' details (shareName, storageAccountName, and storageAccountKey), and a 'volumeMounts' block inside the container definitions specifying the volume name and mountPath.Cevap
- CAn 'imageRegistryCredentials' block specifying the ACR server with the 'username' set to the managed identity's client ID and the 'password' set to a token retrieved from Azure Key Vault.
- DA 'volumes' block at the container group root level specifying a 'managedIdentity' volume type that references the storage account URI, and assigning a Key Vault Access Policy to allow the container group to retrieve the share credentials.
Cevap
To deploy the multi-container group with secure registry authentication and persistent storage, the YAML definition must contain a root-level identity block with the user-assigned identity resource ID coupled with an image registry credentials block pointing to that identity. Additionally, the Azure File share must be declared in a volumes block at the root and mapped to a volumeMounts block within the containers.
To pull container images from a private ACR using a user-assigned managed identity, the container group must have the identity enabled at the root level and referenced in the registry credentials block. To mount an Azure File share, the volume must be defined at the container group root level with the required storage account credentials and referenced in the container definitions under volume mounts.
Adım Adım Çözüm
Anahtar Kavram
Multi-container group configuration in ACI involving secure registry authentication via managed identity and persistent volume mounts.