Azure 容器应用程序:使用 Azure 容器注册表中的私有映像时,ImagePullBackOff 会出现在军团中

问题描述 投票:0回答:1

enter image description here 你好!我是 Azure 容器注册表和 Azure 容器应用程序的新手。 我正在尝试使用 ACR 中的私有映像创建容器应用程序。 我的 ACR 已启用管理员用户的用户名和密码。 我还有一个具有适当权限的托管身份,例如 ACRPull。

我里面有一个 Flask 应用程序正在监听端口 5000

但是,我似乎无法让它工作。 谢谢您的帮助。

我尝试使用门户和 AZ Cli 运行命令,例如:

az containerapp create --name $CONTAINER_APP_NAME --resource-group $RESOURCE_GROUP --environment $CONTAINER_APP_ENVIRONMENT --image $IMAGE --target-port 5000 --ingress 'external' --registry-server $REGISTRY_SERVER  --registry-username $ACR_USERNAME  --registry-password $ACR_PASSWORD --user-assigned $IDENTITY_ID --query configuration.ingress.fqdn
azure-container-registry azure-container-apps
1个回答
0
投票

由于您已经使用管理身份进行身份验证,因此无需再次在脚本中包含 ACR 用户名和密码等凭据。

Image
属性应包含以下格式。

--image $_REGISTRY_NAME.azurecr.io/$IMAGE_NAME:$IMAGETAG

要使用私有容器映像创建容器应用程序,需要以下参数以及

az containerapp create
CLI 命令。

az containerapp create --name "newcont" --resource-group "xxx" --environment "MyContainerappEnvironment" --image "nginx" --target-port 5000 --ingress 'external' --user-assigned "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userj" --query properties.configuration.ingress.fqdn

使用CLI命令创建应用程序环境:

az containerapp env create -n <Name> -g xxx --location eastus2

enter image description here

enter image description here

要检查容器应用程序的创建状态,请使用

az containerapp show
CLI 命令。

© www.soinside.com 2019 - 2024. All rights reserved.