question

QuinnCheong-2020 avatar image
0 Votes"
QuinnCheong-2020 asked ·

Azure functions infrastructure - Best practices

Hello all,

I was reading the AZ Functions best practices documentation and I understand that it is recommended to avoid long running functions. Could I ask if that corresponds to the absolute runtime of the function?

I am asking this question because I am planning to make multiple api calls to external apis in 1 function app. E.g google maps api / google places api. Is this practice recommended, or should i make these api calls in a separate function app and manage the whole workflow with something like AZ Logic apps.

I presume that if we go by a per-request basis, when someone calls my AZ Function, it wont take too long even though I could be making multiple api calls to external resources, hence I would not hit the time-out and could get away with just using 1 function app. I am however, unsure if this is the right way to do it.

Apologies if this question is a little basic as I have just started using MS Azure. Any help and feedback would be great!

Thanks.

Best regards,
Quinn

azure-functions
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

techwatching avatar image
1 Vote"
techwatching answered ·

You should really have a look at Durable Functions. This is an extension of the Azure Functions which allows you to do long-running operations, worflows in a stateful way.
It depends exactly what you are trying but I think it could correspond to your use case. No problem of time-out with Durable Functions as you separate your different calls in different functions (all in the same function app), it's really nice to do workflows where you will have multiple operations / calls.


· 2 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello!

Thanks for getting back to me. I will check out durable functions and see if it fits what i need.

Best regards,
Quinn

0 Votes 0 ·

Thanks, @techwatching!

@QuinnCheong-2020 If the workflow requires stateful orchestration which sounds like is the case from your question, Durable Functions is definitely the way to go! Another option is Logic Apps which is declarative and designer-first, please the comparison doc here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-compare-logic-apps-ms-flow-webjobs

0 Votes 0 ·