gpt4 book ai didi

Azure Functions 与 Docker 镜像错误 : Azure Functions Runtime is unreachable

转载 作者:行者123 更新时间:2023-12-02 21:04:27 24 4
gpt4 key购买 nike

我正在尝试使用 Docker 镜像部署 Hello World Azure Function following this doc至此。唯一的区别是我在该区域使用 WestUS,并将我的镜像上传到 Azure 容器注册表:<myname>.azurecr.io/<imagename>

我使用部署

az functionapp create --name <myppname> --storage-account <mystorageaccount> --resource-group <myresourcegroup> --plan <mypremiumplan> --deployment-container-image-name <myname>.azurecr.io/<imagename>

但是我得到了这个:

Error:

Azure Functions Runtime is unreachable. Click here for details on storage configuration.

我浏览了troubleshooting docs而且这些案例似乎都不相关。可能是什么问题?

最佳答案

对于您的问题,区域不是问题。可能的原因是自定义镜像没有拉取到你的功能计划中,因为你的计划没有拉取的权限。

Azure 容器注册表是私有(private)注册表。你可以看到Note像这样:

If your container is private, you would have to set the following application settings as well

  • DOCKER_REGISTRY_SERVER_USERNAME
  • DOCKER_REGISTRY_SERVER_PASSWORD

You will have to stop and then start your function app for these values to be picked up

这是原因,也是解决办法。

另一种解决方案是您可以使用参数

  • --docker-registry-server-user
  • --docker-registry-server-password

在 CLI 命令中为 ACR 设置凭据。这是引用最新 CLI 版本的新功能。更多详情请参见az functionapp create .

关于Azure Functions 与 Docker 镜像错误 : Azure Functions Runtime is unreachable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58945459/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com