Call specific Azure Function from Event Hub message

Viewed 29

We have an Azure Function project written in Node/JavaScript in which we have a few functions and some of them needs to be called after the other. Currently we're using timeTriggers with some time difference, so that function A gets called and then function B gets called knowing that function A have already been called; the problem is that sometimes there's a delay between these calls and I don't know if function A got executed correctly. One solution that I found was having function A execute, then output an event to an Event Hub, which then triggers function B using an eventHubTrigger.Now, the problem is that I don't know how to route the messages to specific functions. Some examples of expected behaviour/use cases:

Function A finishes -> Calls function B
Function C finishes -> Calls function D

Function A finishes ->
 if data was correctly saved call function B
 if data was NOT correctly saved call function D

PLAN B:

I have also thought about having blobTriggers do this. Having function A save empty data to a blob which triggers function B via blobTriggers, but we've seen up to 20 minutes delay between function A saving data to the blob and function B getting triggered. Are there better ways to do this?

0 Answers
Related