Soru

Zorluk: OrtaManage Container Images in Azure Container Registry

A developer needs to push a locally built container image to a private Azure Container Registry (ACR) named contosoacr. The developer is already authenticated to their Azure subscription using the Azure CLI on their local workstation. Which command should the developer run on their workstation to authenticate the local Docker CLI to the registry using their active Azure CLI session?

  1. az acr login --name contosoacrCevap
  2. B
    docker login contosoacr.azurecr.io
  3. C
    az login --identity
  4. D
    az acr login --username contosoacr

Cevap

az acr login --name contosoacr
The command starting with 'az acr login' with the '--name' parameter is correct because it uses the credentials of the logged-in Azure CLI user to obtain an access token and automatically configure the local Docker client to access the Azure Container Registry.

Adım Adım Çözüm

1
Ensure the Azure CLI is logged in and Docker daemon is running locally.
The local CLI session is authenticated to Azure and Docker commands can be executed.
Authenticating Docker to ACR requires both an active Azure session and a running Docker daemon.
2
Execute the login command targeting the registry name.
The local Docker config.json file is updated with credentials obtained via Azure OAuth token.
This bridges Azure CLI authentication with Docker daemon configuration.

Anahtar Kavram

Azure Container Registry CLI Authentication
Bu soruyu puanla