You need to deploy a containerized application to Azure Container Instances (ACI). The container image is stored in a private Azure Container Registry (ACR). You plan to use a user-assigned managed identity to authenticate to the ACR during the container group creation. You will perform the deployment using a YAML configuration file and the Azure CLI. Once the deployment is complete, you must verify the container startup logs to ensure the application initialized correctly.
Which sequence of actions should you perform?
- 1Create a user-assigned managed identity and assign it the AcrPull role on the Azure Container Registry (ACR).
- 2Retrieve the resource ID of the user-assigned managed identity.
- 3Author a YAML configuration file that defines the container group, referencing the registry credentials and the managed identity resource ID.
- 4Deploy the container group by running the az container create command with the --file parameter pointing to the YAML configuration file.
- 5Verify the deployment and inspect the container startup logs by running the az container logs command.
Cevap
To deploy a container group from a private ACR using a user-assigned managed identity, you must first create the identity and assign it the AcrPull role on the registry. Next, retrieve the resource ID of the managed identity. Use this ID to configure the image registry credentials and identity properties inside the YAML definition file. Then, deploy the container group using the az container create command with the --file parameter. Finally, inspect the startup logs using the az container logs command.
The correct order establishes a logical dependency chain. First, the user-assigned identity must be created and granted the AcrPull role on the ACR to authorize image retrieval. Second, its resource ID must be retrieved so it can be embedded in the deployment manifest. Third, the YAML configuration file must be written to specify the identity and credentials. Fourth, the deployment is executed via the Azure CLI using the --file parameter. Finally, after the containers are running, their logs are inspected to verify initialization.
Adım Adım Çözüm
Anahtar Kavram
Deploying container groups using YAML and authenticating to ACR using a user-assigned managed identity.