Skip to content

Guide for Murano's Azure Event Hub Service

Use of the Azure Event Hub Service in Murano with a custom application solution requires an Advanced Exosite Account.

This guide provides an overview of the steps to use Exosite's Event Hub service available in the Murano Platform. This service is an integration that allows developers to integrate to their own Azure Event Hub from a custom Exosite Murano application solution.

How the Event Hub service works

image alt text

Supported Functionality

The following is currently not supported

Requirements

Please note that Event Hub service only requires a valid Event Hub entity. It doesn't have to be associated with a Data Lake. This guide is provided so that it’s easier to verify that your event has arrived at Event Hub in the quickstart section later.

Please follow Capture data to an Azure Data Lake Store account to create an Event Hub that is associated with a Data Lake.

Quickstart

Add Event Hub service to your Business

Reminder: Use of this service in a Murano application solution requires an Advanced Exosite Account.

Add the Event Hub service in Exchange to your custom Murano Application Solution.

Configure Event Hub service

image alt text

Please ensure all the fields filled in step 4 through 7 are correct, otherwise your call to EventHub.send in the Lua scripts will not work.

  1. Click Eventhub in the service list.
  2. Click the dango icon, and then + New Item in the popup menu.
  3. Fill this in with an ID. This id will be used later in your lua script with the EventHub.send function.
  4. Fill in the SAS key. This key needs to have send permission, and you can find it in the next image at number 1.
  5. Fill in the Event Hub entity name to be used when the EventHub.send function doesn't return one. You can find it at number 2 in the next image.
  6. Fill in the Event Hub namespace, you can find it at 3 in the next image.
  7. Fill in the SAS Key name, you can find it at 4 in the next image.
  8. Click APPLY.

image alt text

Create an Endpoint to send event

image alt text

  1. Click Endpoints.
  2. Click + NEW ENDPOINT.

    image alt text

  3. Select POST from Select Method.

  4. Fill eventhubdemo in Path.
  5. Click CREATE.

    image alt text

  6. Paste the following in the code editor and click SAVE:

    return Eventhub.send({
      id = 'eventhubdemo',
      event_data = to_json(request.body)})
    
    !!! note "" You can also provide an optional event_hub key to override the default event_hub in the service config or provide an optional publisher key to denote the publisher. See the following snippet for example:

    return Eventhub.send({
      id = 'eventhubdemo',
      event_data = to_json(request.body),
      event_hub = 'eventhubdemo2',
      publisher = 'eventhubdemopublisher'})
    

Send event to Event Hub

Please paste the following to your terminal:

curl -X POST \
  https://eventhubdemo.apps.exosite.io/eventhubdemo \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{"hello":"eventhubdemo"}'

The response should look like:

{"body":"","headers":{"Content-Type":"application/xml; charset=utf-8","Date":"Thu, 19 Oct 2017 06:10:12 GMT","Server":"Microsoft-HTTPAPI/2.0","Strict-Transport-Security":"max-age=31536000","Transfer-Encoding":"chunked"},"status_code":201}

See event in Azure Data Lake

image alt text

  1. Browse to the captured data through the Data Explorer.

  2. Click the file.

image alt text

We can see that the data is indeed there.