Send event from sharepoint to eventhub

João Vitor Martins 20 Reputation points
2023-03-27T15:00:11.7533333+00:00

How i can send sharepoints event to eventhub in json format

Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
619 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,610 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA-MSFT 88,471 Reputation points Microsoft Employee
    2023-03-28T08:47:46.77+00:00


    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:

    1. Create an Azure Event Hubs namespace and an Event Hub in it.
    2. Create an Azure Logic App and use the SharePoint connector to trigger it on a specific event in SharePoint.
    3. Add an action in the Logic App to convert the SharePoint event to JSON format.
    4. Add another action to send the JSON-formatted event to the Azure Event Hub.

    Here are the detailed steps:

    1. 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.
    2. 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.
    3. 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.
    4. 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:

    1. Create a new flow in Power Automate.
    2. 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.
    3. 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.
    4. 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.
    5. 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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.