Soru

Zorluk: Çok zorDeploy and Configure Azure Container Apps

You are deploying a containerized application to Azure Container Apps. The container image is hosted in a private Azure Container Registry (ACR) named myregistry.azurecr.io. You have created a user-assigned managed identity named identity-aca in the resource group rg-prod, and the identity has already been granted the AcrPull role on the registry. You need to configure an existing Container App named api-service in the same resource group to use this user-assigned managed identity to authenticate and pull the image from the registry. Which two of the following Azure CLI commands should you run to complete the configuration? (Select TWO.)

  1. az containerapp identity assign -n api-service -g rg-prod --user-assigned "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-prod/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-aca"Cevap
  2. az containerapp registry set -n api-service -g rg-prod --server myregistry.azurecr.io --identity "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-prod/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-aca"Cevap
  3. C
    az containerapp identity assign -n api-service -g rg-prod --system-assigned
  4. D
    az containerapp registry set -n api-service -g rg-prod --server myregistry.azurecr.io --username "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg-prod/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-aca"

Cevap

To configure the Container App to pull images from the private registry using the user-assigned identity, you must first assign the user-assigned identity using the 'az containerapp identity assign' command with the '--user-assigned' parameter. Afterward, you must configure the registry settings using 'az containerapp registry set' with the '--identity' parameter specifying the user-assigned identity's resource ID.
Configuring registry access via a user-assigned managed identity requires two CLI steps: assigning the identity's resource ID to the Container App using the 'az containerapp identity assign' command, and setting the registry authentication behavior using 'az containerapp registry set' with the '--identity' parameter specifying the identity's resource ID.

Adım Adım Çözüm

1
Assign the user-assigned managed identity to the Container App.
The identity is linked to the Container App resource.
The Container App must possess the identity before it can be referenced in registry configuration.
2
Configure the Container App registry settings with the identity.
The Container App registry configuration is updated.
This links the registry server authentication mechanism to the assigned user-assigned managed identity.

Anahtar Kavram

Configuring Azure Container App registry authentication using user-assigned managed identities.
Bu soruyu puanla