Soru

Zorluk: OrtaManage Container Images in Azure Container Registry

You are configuring a self-hosted runner on an Azure Virtual Machine to build and push container images to an Azure Container Registry (ACR) named devregistry2026. You want to use a user-assigned managed identity to authenticate the Virtual Machine runner to the registry. Which two actions should you perform?

  1. Assign the AcrPush role to the user-assigned managed identity.Cevap
  2. Run the az login --identity command on the Virtual Machine.Cevap
  3. C
    Assign the AcrPull role to the user-assigned managed identity.
  4. D
    Assign the AcrPush role to the Virtual Machine's system-assigned managed identity.

Cevap

Assign the AcrPush role to the user-assigned managed identity and run the az login --identity command on the Virtual Machine.
To push container images to Azure Container Registry using a user-assigned managed identity, you must assign the AcrPush role to the identity to grant the necessary write permissions. Additionally, you must run the az login --identity command to authenticate the CLI context on the Virtual Machine using the associated managed identity.

Adım Adım Çözüm

1
Assign the AcrPush role to the user-assigned managed identity for the target Azure Container Registry resource.
The identity is granted write/push permissions to the registry.
Permissions must be explicitly granted using Azure Role-Based Access Control (RBAC) to allow the identity to push images.
2
Run the az login --identity command on the Virtual Machine runner.
The Azure CLI session is authenticated using the managed identity credentials.
This establishes the security context so that subsequent registry interactions are authenticated.

Anahtar Kavram

Azure Container Registry authentication using user-assigned managed identities and Azure RBAC roles.
Bu soruyu puanla