0

I have one requirement to do file merging based on event driven architecture. I am having two blob containers and i need to merge files as soon as they are available in their respective containers. Correlation will happen based on file name.

That means suppose i have two containers, container A and container B. When file comes to container A then it should wait for the file to come in container B and then event should trigger which will get subscribed by ADF or logic app for further processing. Please suggest some way to achieve this.

TechGuru
  • 399
  • 8
  • 20

2 Answers2

2

Event Grid Microsoft.Storage.BlobCreated event will be raised per container and will not wait for another container to raise an event.

One option I could think of is to handle your events using Durable Function where you could use Correlation value as Durable Function instance ID to dentify an existing function or start a new one. If a function instance with a given ID is already running, you'd be able to either perform the merge or raise a new custom event and handle it separately.

Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • Alternatively if you wanted to go down the logic app route as mentioned you can use eventgrid event mentioned as triggers into your logic app, you can have multiple triggers in logic apps and they we will wait one another so if blob a is triggered it will wait for blob b to be triggered before it continues the run – Pete Philters Jul 31 '18 at 15:11
0

another option is creating a simple Distributed Event Aggregator, like is shown in the following screen snippet:

EventAggregator

The concept is based on the Lease Blob where is stored the State of EventAggregator with all received event messages. The HttpTrigger function has a responsibility for handling and managing received event messages, create and update the State and handling a retry delivery for reliable updating a State. In this case, the dead-lettering is used as a Watchdog Timer.

Creating or Updating a Lease Blob will generate an event for subscriber and its logic can see the State of EventAggregator with an array of received event messages.

In the case when we are not using an eventing for Lease Blob (separate storage account), the finally event message with an EventAggregator State can be sent to the Storage queue by HttpTrigger function - EventAggregator.

Roman Kiss
  • 7,925
  • 1
  • 8
  • 21