38
votes

Where can I find guidance on organizing a Visual Studio solution with multiple Azure Functions? Specifically, how should the project be organized?

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?

1
You can also put multiple functions into the same static class if you wish. That's your choice, and if you find issues - you are free to change it at any time.Mikhail Shilkov

1 Answers

47
votes

The MS Azure team will probably have a better answer but this is what has worked for us so far.

  • We have several function apps, each are in their own project (and solution).
  • Of those function apps, some have only a single function, others have multiple functions each in their own class/file.
  • Where we have multiple functions, it is because those functions are all related to a particular feature area of our system. Hence they work together, and for us it makes sense to maintain and deploy them as a group.
  • Other function apps are independent, containing only a single function doing a job unrelated to any other function. E.g. we have one timer driven function that crunches some numbers and sends a push notification as required.
  • Grouping the functions in this way has (so far) made sense for us as it gives us a balance between keeping our deployment relatively simple and being able to scale the 'groups' independently.

Anyway this has proved good enough for our project thus far, but I'd be interested to see if there are better ways.