我应该如何组织具有多个 Azure Functions 的解决方案? [英] How should I organize a solution with multiple Azure Functions?
问题描述
在哪里可以找到有关使用多个 Azure Functions 组织 Visual Studio 解决方案的指南?具体来说,项目应该如何组织?
Where can I find guidance on organizing a Visual Studio solution with multiple Azure Functions? Specifically, how should the project be organized?
单个 Azure 函数驻留在单个类文件中.我想每个函数都可以是它自己的类文件,全部存储在一个项目中.但这是最佳解决方案,还是我会因为项目/解决方案组织不善而冒着未来复杂化的风险?
A single Azure Function resides in a single class file. I suppose each function could be its own class file, all stored within a single project. But is this the optimal solution or do I risk future complications due to a poorly organized project / solution?
推荐答案
MS Azure 团队可能会有更好的答案,但到目前为止这对我们有用.
The MS Azure team will probably have a better answer but this is what has worked for us so far.
- 我们有几个功能应用程序,每个应用程序都在自己的项目(和解决方案)中.
- 在这些函数式应用中,有些只有一个函数,有些则在各自的类/文件中具有多个函数.
- 我们有多个功能,这是因为这些功能都与我们系统的特定功能区域相关.因此,它们一起工作,对我们来说,将它们作为一个组进行维护和部署是有意义的.
- 其他功能应用是独立的,只包含一个功能,完成与任何其他功能无关的工作.例如.我们有一个计时器驱动功能,可以处理一些数字并根据需要发送推送通知.
- 以这种方式对函数进行分组(到目前为止)对我们来说是有意义的,因为它让我们在保持部署相对简单和能够独立扩展组"之间取得平衡.
无论如何,到目前为止,这对于我们的项目来说已经证明足够好了,但我很想看看是否有更好的方法.
Anyway this has proved good enough for our project thus far, but I'd be interested to see if there are better ways.
这篇关于我应该如何组织具有多个 Azure Functions 的解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!