简体   繁体   English

使用 CLI 将 Azure Web 应用程序(容器)连接到 Azure 容器注册表

[英]Connecting an Azure Web app (container) to an Azure container registry using the CLI

I'm trying to Connect a Azure Webb app (containers) to an Azure Container Registry Using the Azure CLI.我正在尝试使用 Azure CLI 将 Azure Webb 应用程序(容器)连接到 Azure 容器注册表。 I have an Azure Container Registry located in the same Ressouce Group as the Webb App.我有一个 Azure 容器注册表,位于与 Webb 应用程序相同的资源组中。 My command looks like this: az webapp config container set --name "containerbugdemo" --resource-group "Containerbug" --docker-custom-image-name "application/helloworld:latest" --docker-registry-server-url "https://"$arcName.azurecr.io" --docker-registry-server-password "****" --docker-registry-server-user "***" After running the command the container settings blade shows the following error:我的命令如下所示: az webapp config container set --name "containerbugdemo" --resource-group "Containerbug" --docker-custom-image-name "application/helloworld:latest" --docker-registry-server-url "https://"$arcName.azurecr.io" --docker-registry-server-password "****" --docker-registry-server-user "***"运行命令后容器设置刀片显示以下错误:

Failed to get a list of tags.无法获取标签列表。

And the Container fails to get pulled by the WebApp.并且容器无法被 WebApp 拉取。 If I try the same procedure only using the graphical interface through the Azure portal, everything works as expected.如果我通过 Azure 门户仅使用图形界面尝试相同的过程,一切都会按预期工作。

It seems you set the wrong image name.看来您设置了错误的图像名称。 If you use the image in the ACR, you need to set the image name as acrname.azurecr.io/repository:tag , both when you create the web app and container setting, not just repository:tag .如果在 ACR 中使用映像,则需要在创建 web 应用程序和容器设置时将映像名称设置为acrname.azurecr.io/repository:tag ,而不仅仅是repository:tag And the server URL is also a mistake that one more double quote in the question.而服务器 URL 也是一个错误,问题中多了一个双引号。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 容器注册表授权 Azure Web 应用程序 - Azure Container Registry authorization for Azure Web App "Azure LogicApp 连接到 Azure 容器注册表" - Azure LogicApp connecting to Azure Container Registry 使用Azure容器注册表的容器CI的Azure Web App - Azure Web App for containers CI with Azure Container Registry Azure Web App for Containers 中跨订阅的 Azure 容器注册表 - Azure Container Registry in Azure Web App for Containers across subscriptions Powershell + Azure 应用服务 + Azure 容器注册表 - Powershell + Azure App Service + Azure Container Registry 在 Azure 向导“创建 Web 应用程序”中使用图像源:“Azure 容器注册表”而不是图像源:“私有注册表”的好处? - Benefit in using Image Source: `Azure Container Registry` over Image Source: `Private Registry` in Azure wizard `Create Web App`? Azure 容器注册表权限 - Azure Container Registry Permissions Azure 容器注册表存储库或映像删除在使用 Azure CLI 或命令 Shell 执行时出错 - Azure container registry repository or image delete giving error while executing using Azure CLI or Command Shell Pulumi:添加Azure Web App Service web hook到Azure Container Registry进行持续部署 - Pulumi: Add Azure Web App Service web hook to Azure Container Registry for continuous deployment 使用 Az CLI 创建新的 Azure 容器实例时,无法从私有 Azure 容器注册表中提取映像 - Can't pull image from private Azure Container Registry when using Az CLI to create a new Azure Container Instance
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM