1
votes

I've recently started experimenting with Azure functions and I'd like to get some info on whether the following makes sense and is possible..

How feasible is it to build a normal .NET Core Web API following DDD patterns but replacing the API endpoints with durable azure functions? Is this a possible use case for Azure Functions, to make the web API "serverless"?

And how would the whole thing be structured? Does each Azure function need its own project or can they all be placed in one project?

Thanks

1
Why not? Azure functions is great its not only http but also event processing. You can even design "context" to be your microservice then you will get even more flexibility - Vova Bilyachat
Thanks for the reply. What do you mean by designing "context" to be a microservice? Didn't quite get that part. - Night Spark
Ah I get it now, thanks, this helps. :) - Night Spark
Ah I see, so using normal azure functions should be fine as well? - Night Spark

1 Answers

1
votes

As I wrote in comments why not?

  1. You can define bounded context and deploy to one azure function as microservice for instance service which will be responsible for orders, other azure function of delivery and so on.

  2. Use durable function when you need to orchestrate actions, for instance you have buy flow when in first action you lock products, take payments and unlock so you have kind of dependency on each other.

  3. You can use azure functions with service bus or azure queue storage for event processing.

One thing keep in mind that when you design function you have time limitations is up to 5 minutes on provisioning plan. So when you design newsletter for instance keep in mind that you would need to send email in batches.