[英]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
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>
替换为您的注册表名称。
--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://
后跟注册表的完全限定域名。<app-name>
is correct.如果您遇到错误“AttributeError: 'NoneType' object has no attribute 'reserved'”,请确保您的<app-name>
是正确的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.