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.
Overview Materials
How the Event Hub service works¶
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¶
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.
- Click Eventhub in the service list.
- Click the dango icon, and then + New Item in the popup menu.
- Fill this in with an ID. This id will be used later in your lua script with the EventHub.send function.
- Fill in the SAS key. This key needs to have send permission, and you can find it in the next image at number 1.
- 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.
- Fill in the Event Hub namespace, you can find it at 3 in the next image.
- Fill in the SAS Key name, you can find it at 4 in the next image.
- Click APPLY.
Create an Endpoint to send event¶
- Click Endpoints.
-
Click + NEW ENDPOINT.
-
Select POST from Select Method.
- Fill
eventhubdemo
in Path. -
Click CREATE.
-
Paste the following in the code editor and click SAVE:
!!! 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)})
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¶
-
Browse to the captured data through the Data Explorer.
-
Click the file.
We can see that the data is indeed there.