Azure 函数的自定义触发器和绑定

Custom Triggers and Bindings for Azure Function

我们希望我们的 Azure 函数使用自定义触发器绑定,因此如果我们想从服务总线触发器更改为 HttpTrigger,我们应该能够通过一些配置/应用程序设置更改而不是代码更改轻松地完成。有没有一种方法可以编写自定义触发器 class 实现。我们目前使用的是.Net core 3.1.

是的,这可以通过实施 ITriggerBinding 来实现,但有一些严重的缺点:在消费计划 运行 时不支持自定义激活/缩放逻辑。 (source). There are some ideas about how support for custom triggers could be added that would run in the Functions Premium plan. The reason it would depend on the premium plan is that there is always at least one VM assigned to the plan, and it could run your activation/scaling logic. (source).

如果您仍想继续,here 是概述所涉及步骤的博文。它相当过时,因此您可能需要在这里和那里更改一些东西。