Azure EventHub, Logic Apps, and DataVerse


Welcome to “Continuous Improvement,” the podcast where we explore practical tips and strategies to enhance your work processes and boost your productivity. I’m your host, Victor, and today we’re diving into the world of data synchronization between Apache Kafka and Microsoft Cloud for Financial Services (FSI). In this episode, we’ll walk you through the steps to export and import Kafka messages to FSI and discuss the benefits of integrating these two powerful platforms. So, let’s get started!

First things first, let’s understand the process of exporting Kafka messages to Azure EventHub, one of the components of Microsoft Cloud for FSI. To achieve this, we’ll be using a Python script that sends event messages to Azure EventHub.

[Background explanation]

Here’s an example Python script to get you started. You would need to replace the placeholders with your own EventHub name and connection string. The script sends three simple event messages to Azure EventHub, demonstrating the process of exporting data.

[Code snippet]

Once you’ve customized the script, execute it. If everything goes well, you should see a message indicating the successful delivery of the events. But remember, if you encounter any errors, double-check the placeholder values to ensure they are correct.

With the Kafka messages successfully sent to Azure EventHub, the next step is to connect Azure EventHub to Logic Apps. Logic Apps will act as the workflow automation tool to synchronize data from EventHub to DataVerse, another component of Microsoft Cloud for FSI. Let’s walk through the process.

[Background explanation]

Start by navigating to the Azure portal and searching for Logic Apps. Create a new Logic App to serve as your automated workflow. EventHub events will act as the trigger, while DataVerse will be the output. For development purposes, choose the “Consumption” plan type, suitable for entry-level development.

Once your Logic App is created, access the Logic App designer. The process involves three main steps: EventHub trigger, initializing variables, and adding a row to DataVerse.

[Background explanation - EventHub Trigger]

In the first step, configure the Logic App to connect to EventHub as the trigger. For development purposes, set the check interval to 3 seconds to ensure smooth processing.

[Background explanation - Initialize Variables]

Now let’s move on to step two – initializing variables. In this step, you’ll parse the message received from EventHub. The sample message structure would look something like this:

{
    "id": "something"
}

To extract the value using the key “id,” you can utilize the provided expression:

json(decodeBase64(triggerBody()['ContentData']))['id']

This expression helps you retrieve the specific data you require from the received message.

[Background explanation - Add a Row to DataVerse]

Finally, the last step involves adding a row to DataVerse. Utilize the database connector to accomplish this. If the table doesn’t exist yet, you can create one by navigating to https://make.powerapps.com/ and selecting DataVerse. Populate the fields with the variables initialized in step two.

Congratulations! You’ve successfully set up the connection between Azure EventHub and Logic Apps, ensuring continuous data synchronization from Kafka to DataVerse within Microsoft Cloud for FSI.

But wait, what exactly is DataVerse? Well, DataVerse serves as a database for storing data in tables. Once your Logic App is triggered by a new event, you’ll see a new row added to the DataVerse table.

[Background explanation]

And with all the data seamlessly synced to Azure FSI, you can now explore the various components offered by Microsoft Cloud for FSI. For instance, the Unified Customer Profile allows you to efficiently manage customer data, providing a comprehensive view of each customer.

Access the Microsoft Cloud Solution Center at https://solutions.microsoft.com/ to explore and select the desired component that best suits your needs. And don’t forget that you can launch the Dynamics 365 sandbox from the Solution Center to see the Unified Customer Profile app in action with pre-populated sample data.

[Closing remarks]

That wraps up today’s episode of “Continuous Improvement.” We hope you’ve found value in learning how to export Kafka messages to Azure EventHub, synchronize data to DataVerse using Logic Apps, and leverage the powerful components provided by Microsoft Cloud for FSI. If you have any questions about setting this up or need further assistance, feel free to reach out.

Remember, continuous improvement is all about finding ways to enhance our processes and stay ahead of the game. Join us again next week for another insightful episode. Until then, keep improving and stay productive!