Azure 函数发布已删除的现有函数

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

我在 Visual Studio 解决方案中有两个不同的 Azure Function 项目。当我将第二个项目发布到 Azure 中的同一 Azure Functions 应用程序时,已部署的函数将被删除。有没有办法让功能共存?

谢谢你 安吉洛

azure-functions publish
1个回答
0
投票

您需要将所有功能放在 Visual Studio 中的单个项目中才能部署在 azure 上并保留预先部署的功能。如果您的函数不在同一项目中,则新部署将覆盖之前的部署。

我已经在我的环境中重现了。我也有同样的问题;预部署的功能被新部署的功能删除。 我创建了两个函数,一个 HTTP 触发器名称“Httptrigger1” 和时间触发器“Function1” 两者都分别在 Testtest2 文件夹中创建,具有相同的项目名称 “multiplefunction” 并部署到我在 Azure 上的函数 “publishmultiplefunctionon”。 如下所示: Http触发:

enter image description here

enter image description here

enter image description here

enter image description here

时间触发:

enter image description here

enter image description here

enter image description here

enter image description here

如您所见,它覆盖了之前的 Httptrigger1 函数。

要部署新功能而不覆盖,您需要在同一项目中创建新功能。 我创建了名为 Function2 :

的新 Httptrigger

enter image description here

您可以更改底部的函数名称:

enter image description here

您可以选择触发器和授权:

enter image description here

enter image description here

enter image description here

enter image description here

使用 VS code 进行部署时,它会在部署到 Azure 之前向您显示警告消息。

enter image description here

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