João Vitor Martins - Thanks for the question and using MS Q&A platform.
You can use SharePoint workflows and Azure Logic Apps to send events in JSON format from SharePoint to Azure Event Hubs.
Here are the high-level steps to achieve this:
- Create an Azure Event Hubs namespace and an Event Hub in it.
- Create an Azure Logic App and use the SharePoint connector to trigger it on a specific event in SharePoint.
- Add an action in the Logic App to convert the SharePoint event to JSON format.
- Add another action to send the JSON-formatted event to the Azure Event Hub.
Here are the detailed steps:
- Create an Azure Event Hubs namespace and an Event Hub in it:
- Login to the Azure portal.
- Create an Azure Event Hubs namespace.
- Inside the namespace, create an Event Hub.
- Create an Azure Logic App and use the SharePoint connector to trigger it on a specific event in SharePoint:
- Login to the Azure portal.
- Create an Azure Logic App.
- Add the SharePoint connector to the Logic App and configure it to trigger on a specific SharePoint event.
- Add an action in the Logic App to convert the SharePoint event to JSON format:
- Add a "Data Operations - Compose" action to the Logic App.
- Use the dynamic content from the SharePoint trigger to build a JSON object.
- Add another action to send the JSON-formatted event to the Azure Event Hub:
- Add an "Azure Event Hubs - Send Event" action to the Logic App.
- Use the JSON object created in the previous step as the event data.
That's it! Your SharePoint events will now be sent to the Azure Event Hub in JSON format.
Note: Make sure to configure the necessary permissions and access keys in the Azure portal for the Logic App and Event Hub to communicate with each other.
OR
To send SharePoint events to an Azure Event Hub in JSON format, you can use Microsoft Power Automate (formerly known as Microsoft Flow). Here are the high-level steps to achieve this:
- Create a new flow in Power Automate.
- Add a SharePoint trigger to the flow. This will allow you to specify the SharePoint site and list that you want to monitor for events.
- Add a "Parse JSON" action to the flow. This will allow you to parse the SharePoint event data into a JSON format that can be sent to the Event Hub.
- Add an "HTTP" action to the flow. This will allow you to send the JSON data to the Event Hub. You will need to specify the Event Hub URL and authentication details in this action.
- Save and test the flow.
For more detailed instructions and screenshots, you can refer to the official Microsoft documentation on Connect to an event hub from workflows in Azure Logic Apps.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.