Azure, Power Platform and Everything cloud

One major difference between Azure service bus and Azure event hub is, only service bus offers the guarantee to deliver “only once”.

Still, you need to be careful using logic apps or azure function to make sure this is performed in the right way.

Let start with logic apps:

First, select one of the “peek-lock” triggers like “When one or more messages arrive in a topic (peek-lock)”

There are triggers for queue, topic and subscription, to retrieve singles, batches on “peek-lock” mode or “Auto-complete”

Auto-complete reads and removes from the queue, so, if the implementation fail, you may lose that message.

Add some implementation, like parsing the message and inserting into Dataverse.

Once the flow operation is completed, add a “Complete the message…” task. This will remove the processed message from the queue and avoid reprocessing it.

Azure Function trigger for Service Bus

The function trigger for Service bus already has the above set by default:

more here: Azure Service Bus trigger for Azure Functions | Microsoft Learn

You can find an example of an Azure Service Bus trigger inserting data into Dataverse here. That function is Version 4 and using NET 7:

Dataverse_Azure_Integration/Dataverse.ServiceBusTrigger.Isolated at master · BrunoLucasCloud/Dataverse_Azure_Integration (github.com)

Leave a Reply

Discover more from Bruno Lucas Azure Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading