An organization plans to host a background task container in Azure Container Apps. The container image is stored in a private Azure Container Registry named `myregistry.azurecr.io`. A developer creates a user-assigned managed identity named `my-pull-identity` to allow secure access to the registry. The Bicep template includes the user-assigned managed identity in the top-level `identity` block of the Container App resource.
To ensure the container app can successfully authenticate and pull the image from the private registry during deployment, which code block must be included inside the `properties` section of the Container App resource definition?
- configuration: {
registries: [
{
server: 'myregistry.azurecr.io'
identity: myPullIdentity.id
}
]
}Cevap - Bconfiguration: {
registries: [
{
server: 'myregistry.azurecr.io'
identity: 'System'
}
]
} - Cconfiguration: {
registries: [
{
server: 'myregistry.azurecr.io'
username: 'my-pull-identity'
passwordRef: 'acr-password'
}
]
} - Dconfiguration: {
registries: [
{
server: 'myregistry.azurecr.io'
identity: myPullIdentity.name
}
]
}
Cevap
The configuration block with registries specifying the server as 'myregistry.azurecr.io' and the identity as the user-assigned managed identity's resource ID (myPullIdentity.id) inside the properties.configuration section.
The correct configuration block uses the `properties.configuration.registries` array to define the registry server and references the resource ID of the user-assigned managed identity using `myPullIdentity.id`. This complies with Azure Resource Manager specifications for pulling container images from a private Azure Container Registry using a user-assigned managed identity.
Adım Adım Çözüm
Anahtar Kavram
Configuring private Azure Container Registry access for Azure Container Apps using user-assigned managed identities in a Bicep template.