简体   繁体   English

Azure 应用服务私有容器注册表登录问题

[英]Azure app service private container registry login problem

I am using gitlab container registry and azure app service.我正在使用 gitlab 容器注册表和 azure 应用程序服务。 in the app service I pull container from gitlab and serve it as a service.在应用程序服务中,我从 gitlab 中提取容器并将其作为服务提供。 My problem is I push the new image from gitlab-ci.yaml to app's container settings but the problem is it clears up the login and password info under container settings, each time I push a new container version.我的问题是我将新图像从 gitlab-ci.yaml 推送到应用程序的容器设置,但问题是每次推送新的容器版本时,它都会清除容器设置下的登录名和密码信息。 So, I have to type my gitlab deploy token in the container settings page.所以,我必须在容器设置页面中输入我的 gitlab deploy 令牌。 How can I prevent this?我怎样才能防止这种情况? Thanks.谢谢。 See the image看图

在此处输入图片说明

Instead of using this to update your Web App而不是使用它来更新您的 Web 应用程序

az webapp create

Try using尝试使用

az webapp config container set --docker-custom-image-name MyDockerCustomImage --docker-registry-server-password StrongPassword --docker-registry-server-url [] --docker-registry-server-user DockerUserId --name MyWebApp --resource-group MyResourceGroup

Documentation 文档

Here agree with CSharpRocks , according to the official document , we need to use the az webapp config container set command to specify the container registry and the image to deploy for the web app:这里同意CSharpRocks ,根据官方文档,我们需要使用az webapp config container set命令为web应用指定容器注册表和要部署的镜像:

az webapp config container set --name <app-name> --resource-group AppSvc-DockerTutorial-rg --docker-custom-image-name <registry-name>.azurecr.io/appsvc-tutorial-custom-image:latest --docker-registry-server-url https://<registry-name>.azurecr.io

For details:详情:

Replace <app_name> with the name of your web app and replace <registry-name> in two places with the name of your registry.<app_name>替换为您的 Web 应用程序的名称,并将两个位置的<registry-name>替换为您的注册表名称。

  • When using a registry other than Docker Hub (as this example shows), --docker-registry-server-url must be formatted as https:// followed by the fully qualified domain name of the registry.使用 Docker Hub 以外的注册表时(如本示例所示),-- --docker-registry-server-url格式必须为https://后跟注册表的完全限定域名。
  • The message, "No credential was provided to access Azure Container Registry. Trying to look up..." tells you that Azure is using the app's managed identity to authenticate with the container registry rather than asking for a username and password.消息“未提供访问 Azure 容器注册表的凭据。正在尝试查找...”告诉您 Azure 正在使用应用的托管标识向容器注册表进行身份验证,而不是要求提供用户名和密码。
  • If you encounter the error, "AttributeError: 'NoneType' object has no attribute 'reserved'", make sure your <app-name> is correct.如果您遇到错误“AttributeError: 'NoneType' object has no attribute 'reserved'”,请确保您的<app-name>是正确的。

暂无
暂无

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

相关问题 Azure APP服务。+私有链接+ Azure容器注册表 - Azure APP Service.+ Private Link + Azure Container Registry 如何使用私有 Azure Container Registry 创建一个 Azure APP Service? - How to create a Azure APP Service with a private Azure Container Registry? Docker 通过服务原理登录到 Azure 容器注册表 - Docker login to Azure Container Registry by Service Principle Powershell + Azure 应用服务 + Azure 容器注册表 - Powershell + Azure App Service + Azure Container Registry Azure 应用服务未选择 Gitlab 容器注册表配置作为私有存储库 - Azure app Service not picking up Gitlab Container Registry Configuration as Private Repository Azure容器注册表中的Azure App Service连续部署 - Azure App Service continuous deployment from Azure Container Registry Azure 容器 - 无法登录私有注册表“从 docker 注册表收到错误响应” - Azure Container - can not login to private registry “Error response received from the docker registry” 无法将私有 github 注册表中的 docker 图像部署到 Azure 应用服务 - Cannot deploy docker image in private github registry to Azure App Service "Azure Web 应用容器专用终结点部署不适用于专用终结点容器注册表" - Azure web app container private Endpoint deployment doesn't work with private endpoint container registry 在 Azure App Service 问题上部署 Docker Container Registry - Deploying Docker Container Registry on Azure App Service Issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM