none
Multiple or single function apps RRS feed

  • Question

  • I have some background tasks I am looking at moving into Azure Functions. I notice in a function pp I can have multiple functions. What is the best practice, one function per app or having all functions in one app? Or is it best to just do divide them based on logical groups or load?
    • Edited by Craig vn Thursday, July 6, 2017 3:41 AM
    Thursday, July 6, 2017 3:41 AM

Answers

  • There´s no easy right or wrong answer here. In general I would go with a logical grouping where multiple functions are put into one function app.

    Say you have a web site with a documentation part, and an API part (and these are in some way split up in different VS projects or something). Put the API-related functions in one app, and put the docs in another.

    But of course, maybe it´s a basic site so the API and docs part are in the same VS project so maybe they logically belong too, and then you can go the other way :)

    Basically, divvy them up as you like. The most important part of this is the load - all functions in one app will share the same resources. So if you expect one function to consume a lot of memory or CPU time you might consider placing it in its own app.

    • Marked as answer by Craig vn Thursday, July 6, 2017 10:20 AM
    Thursday, July 6, 2017 8:34 AM

All replies

  • There´s no easy right or wrong answer here. In general I would go with a logical grouping where multiple functions are put into one function app.

    Say you have a web site with a documentation part, and an API part (and these are in some way split up in different VS projects or something). Put the API-related functions in one app, and put the docs in another.

    But of course, maybe it´s a basic site so the API and docs part are in the same VS project so maybe they logically belong too, and then you can go the other way :)

    Basically, divvy them up as you like. The most important part of this is the load - all functions in one app will share the same resources. So if you expect one function to consume a lot of memory or CPU time you might consider placing it in its own app.

    • Marked as answer by Craig vn Thursday, July 6, 2017 10:20 AM
    Thursday, July 6, 2017 8:34 AM
  • Thanks, this is pretty much what I was thinking as well.
    Thursday, July 6, 2017 10:21 AM
  • One useful thing to consider when making this type of decision is what do you want your unit of deployment to look like? Components that you want to be able to deploy separately should be separate function apps.
    Thursday, July 6, 2017 6:19 PM