【发布时间】:2022-01-06 18:51:49
【问题描述】:
我正在尝试使用 .NET 6 和 dotnet-isolated 运行一组 Azure 函数。在本地运行时,正确调用 Program.cs/Main 方法。发布到 Azure 时,永远不会调用 Program.cs/Main 方法(这会导致失败,因为 DI 未初始化)。
我的 local.settings.json 看起来像:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"FUNCTIONS_EXTENSION_VERSION": "~4"
}
}
在 Azure 门户上,查看实时流,我可以看到以下内容:
2022-01-06T18:38:22.618Z INFO - Starting container for site
2022-01-06T18:38:22.619Z INFO - docker run -d -p 8081:8081 --name lolnotsofast_0_b59188ad_msiProxy -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=lolnotsofast.azurewebsites.net -e WEBSITE_INSTANCE_ID=[lots of hex] appsvc/msitokenservice:[some #s]
2022-01-06T18:38:22.619Z INFO - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2022-01-06T18:38:28.950Z INFO - Pulling image from Docker hub: mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated5.0-appservice-stage6
2022-01-06T18:38:29.127Z ERROR - DockerApiException: Docker API responded with status code=NotFound, response={"message":"manifest for mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated5.0-appservice-stage6 not found: manifest unknown: manifest tagged by \"4-dotnet-isolated5.0-appservice-stage6\" is not found"}
2022-01-06T18:38:29.128Z WARN - Image pull failed. Defaulting to local copy if present.
2022-01-06T18:38:29.130Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)
2022-01-06T18:38:41.279Z INFO - Stopping site cca-amznintegration-d-func because it failed during startup.
问题的症结似乎在于这个容器映像 mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated5.0-appservice-stage6 是未知的。
我不知道这个名字是在哪里/如何被占卜的,也不知道它的含义。
关于如何从这里开始的任何想法?
谢谢!
【问题讨论】:
标签: azure azure-functions azure-functions-runtime