You are configuring a multi-registry container build workflow in Azure. You have a main Azure Container Registry (ACR) named `prodacr` where you want to build and store application images, and a secured ACR named `sharedacr` that hosts the base images.
You need to configure an ACR task named `AppBuildTask` in `prodacr` to build an image from a GitHub repository. The build process must pull the base image from `sharedacr` using the task's system-assigned managed identity.
Which sequence of steps should you perform to configure the task?
- 1Run the `az acr task create` command with the `--assign-identity` parameter to create the task and enable its system-assigned managed identity.
- 2Run the `az acr task show` command with a query to retrieve the `principalId` of the newly created system-assigned managed identity.
- 3Run the `az role assignment create` command to assign the `AcrPull` role to the retrieved `principalId` at the scope of the `sharedacr` registry.
- 4Run the `az acr task credential add` command with the `--login-server` and `--use-identity [system]` parameters to configure the task to authenticate to `sharedacr`.
Cevap
First, create the task with a system-assigned managed identity. Second, retrieve the principal ID of the identity. Third, assign the AcrPull role to the identity at the scope of the base registry. Fourth, add the base registry credentials to the task using the system-assigned identity.
The correct order establishes the identity during task creation, retrieves its principal ID, authorizes it to pull from the base registry, and configures the task credentials to use that identity.
Adım Adım Çözüm
Anahtar Kavram
ACR Tasks cross-registry authentication using system-assigned managed identities
Tahmini Süre:3m 0s