0

Use case

I'd like to build a workflow for a specific process and want to use Azure functions to achieve this.

All these functions needs to be "chained" and the process cannot continue if one function fails. I need to get an updated status during the process so the front-end side of my app can inform the user about the process. I also want to a CI process that allows me to push each function individually.

Best solution would have one public function and multiple "private" functions not accessible publicly (only triggered by other Azure Functions)

Question

I thought about using Durable Functions at first, but it looks like it is not adapted for my use case since it is not easy to call Azure Functions from the orchestrator.

I'm now thinking about Event Grid. Is this a good choice to you ? How to handle a global status I can retrieve from the front-end side of the app ?

Thanks in advance !

J.

  • 2
    "it is not easy to call Azure Functions from the orchestrator" Please elaborate since the orchestrator's primary job is to call other functions. – CSharpRocks Apr 23 '19 at 10:18
  • I guess it is possible by triggering an HTTP event in the orchestrator, but I felt like it was not the best solution (and I don't want to expose my other Azure Functions) – John G. Apr 23 '19 at 10:59
  • 1
    There are numerous ways to secure your functions and prevent direct access – CSharpRocks Apr 23 '19 at 11:04
  • So you would recommend to to stick to Durable Functions with separate Azure Functions triggered by the orchestrator ? – John G. Apr 23 '19 at 11:45
  • You should dig in the documentation and try to understand what are `activity` functions – Thomas Apr 23 '19 at 12:04
  • @Thomas I'm going to.check that – John G. Apr 23 '19 at 12:14

1 Answers1

0

To me, your situation sounds like a very good fit for Durable Functions since you can program your workflow in the orchestrator function and handle retries and exceptions as you desire. Note that the orchestrator function calls activity functions which reside in the same Function App. There is no communication between Function Apps in Durable Functions (unless you do some 'creative' coding to call a new orchestration from an activity).

You can also utilize the custom orchestration status to provide feedback to the client about the status of the workflow.

I would definitely suggest to keep orchestrations small (not too many activity functions) to keep the orchestration easy to understand and unittestable. A few more tips about grouping functions in a Function App in this blogpost.

Lastly, if you have distinct processes in your workflow, which require seperate scaling or deployment, you could also think of combining EventGrid and Durable Functions. E.g. the first Function App does the initial part of the flow and one of the activities triggers an EventGrid event. The second Function App can be triggered by that event and performs the rest of the workflow.

Marc
  • 1,798
  • 8
  • 15