Azure Functions - Kudu - 从 Visual Studio 部署 - 无法从 package.txt 初始化运行

问题描述 投票:0回答:1

当我将 Azure Function (.NET 6) 从 Visual Studio 2022 社区版本部署到 Azure Portal Function App 时,它在 Kudu 站点中向我显示了此错误:

我是这样发布的:Visual Studio > Project > Build > Publish > Azure Function App (Windows) - 标记“从包运行”的复选框选项

谁能帮我解决这个问题。另外,如何消除黄色背景的警告?

azure azure-functions .net-6.0 visual-studio-2022
1个回答
0
投票

回答我的评论作为答案。

我尝试将 Azure Function (.NET 6) 部署到 Azure Function 应用程序,但没有收到任何警告消息。

创建了一个函数应用程序(.Net 6)并成功将其部署到Azure函数应用程序。

enter image description here

enter image description here

enter image description here

enter image description here

您的应用程序当前处于只读模式,因为您正在从 包文件。要进行任何更改,请更新您的内容 zip 文件和 WEBSITE_RUN_FROM_PACKAGE 应用程序设置。

避免出现上述警告信息 在函数应用程序的环境变量中添加

WEBSITE_RUN_FROM_PACKAGE value to 0

WEBSITE_RUN_FROM_PACKAGE 设置的目的是控制 Azure Functions 的执行方式,直接从包文件(将其设置为 1)或从部署的文件(将其设置为 0)执行。

enter image description here

现在没有出现任何警告消息。

enter image description here

这是部署后的输出。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.