azure - Azure 应用服务无法访问注册表中的映像
问题描述
我正在 Azure 中部署具有相关容器映像的应用服务。我使用所有者用户(我唯一拥有的用户)创建了应用服务和图像。不过,当我启动应用服务时,我收到“图像未授权”的错误(见下文)。如何解决这个问题?
映像已创建并存储在注册表中,没有任何问题。
2021-07-26T15:03:31.157Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2021-07-26T15:03:37.000Z INFO - Stopping site sofiana because it failed during startup.
2021-07-26T15:06:32.588Z INFO - Starting container for site
2021-07-26T15:06:32.590Z INFO - docker run -d -p 8081:8081 --name sofiana_1_e0d93acf_msiProxy -e PORT=8081 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=sofiana.azurewebsites.net -e WEBSITE_INSTANCE_ID=4c49e5ee1c9d26e3d207f81f51be02bb2c4d67839b9f7b25c24fceef7fd9b44e appsvc/msitokenservice:2007200210
2021-07-26T15:06:32.592Z INFO - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-07-26T15:06:43.616Z INFO - Pulling image from Docker hub: sofacr.azurecr.io/nginx-visualbank:latest
2021-07-26T15:06:43.697Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://sofacr.azurecr.io/v2/nginx-visualbank/manifests/latest: unauthorized: authentication required, visit https://aka.ms/acr/authorization for more information."}
2021-07-26T15:06:43.700Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2021-07-26T15:06:49.634Z INFO - Stopping site sofiana because it failed during startup.
解决方案
您需要针对存储库进行身份验证
az acr login --name sofacr --subscription AZURE-SUB
推荐阅读
- r - 通过将行的名称与 R 中的另一个表进行比较,从表中选择行
- c# - 统一四元数,保持 x 和 z 旋转不变
- r - R:根据 24 小时时间框架分配组
- ruby - Oauth 客户端在基本身份验证后具有 Doorkeeper 提供程序
- python - 我们如何使用带有 string.join() 的自定义迭代?
- java - 在 JSF dataTable 中删除数据库的行
- javascript - 是否可以更改 ngrx/entities 中的 id?
- javascript - Angular 6,UI 未显示
- javascript - 一页中有两个 flex 滑块
- google-bigquery - 从表中读取 BigQuery 数值数据类型