You are designing an automated deployment for a batch processing workload using Azure Container Instances (ACI). The workload has the following requirements:
1. It must run two containers: a file downloader (producer) and a data analyzer (consumer).
2. Both containers must share a temporary directory that only needs to persist during the lifecycle of the container group.
3. The container images are hosted in a private Azure Container Registry (ACR).
4. The consumer container must securely retrieve a database connection string from an Azure Key Vault.
5. The container group must be deployed inside a subnet of an existing Azure Virtual Network to connect to a private database.
Which three actions should you perform to meet these requirements?
- Delegate the target subnet within the Azure Virtual Network to the Microsoft.ContainerInstance/containerGroups service before deployment.Cevap
- Configure a shared volume of type emptyDir in the container group YAML definition and mount it to both the producer and consumer containers.Cevap
- Create a user-assigned managed identity, grant it the AcrPull role on the Azure Container Registry, and configure the container group to pull images using this identity.Cevap
- DEnable a system-assigned managed identity on the container group and grant it the AcrPull role on the Azure Container Registry to authenticate image pulls.
- ERun the az acr login command in the local Azure CLI session to automatically authorize the Azure Container Instances service host to pull registry images.
- FGrant the container group's managed identity the Set and Delete secret permissions in the Azure Key Vault access policies to retrieve the database credentials.
Cevap
To deploy the solution, you must delegate the virtual network subnet to the container group service, configure an emptyDir volume for ephemeral shared storage, and configure a user-assigned managed identity with the AcrPull role on the private Azure Container Registry to authorize the image pull.
Delegating the subnet to the ACI service is required for VNet integration. Using an emptyDir volume provides shared, ephemeral file storage between containers in the same container group. Using a user-assigned managed identity with the AcrPull role is required because system-assigned identities do not exist in time to authorize the initial image pull during deployment.
Adım Adım Çözüm
Anahtar Kavram
Azure Container Instances networking, volumes, and private registry authentication