Skip to content

Latest commit

 

History

History
151 lines (131 loc) · 7.53 KB

File metadata and controls

151 lines (131 loc) · 7.53 KB
layout docwithnav-pe
title Azure Event Hub Integration
description Azure Event Hub Integration Guide
create_eventhub
0 1 2 3 4 5 6
image title
/images/azure-event-hub/create_a_resource.png
In the Azure portal, click on the "Create a resource" button;
image title
/images/azure-event-hub/select_iot_hub.png
In the search field, type "IoT Hub" and select the matching item from the list;
image title
/images/azure-event-hub/create_iot_hub.png
Click "Create";
image title
/images/azure-event-hub/basics_iot_hub.png
On the configuration page, click "Create new", specify the resource group and IoT hub name, then click "Review + create";
image title
/images/azure-event-hub/create_basics_iot_hub.png
On the next page, click "Create";
image title
/images/azure-event-hub/deployment_is_in_progress.png
Wait for the deployment process to complete;
image title
/images/azure-event-hub/go_to_resource.png
Click "Go to resource".
create_device
0 1 2 3
image title
/images/azure-event-hub/iot_devices.png
Navigate to the "IoT devices" page from the context menu;
image title
/images/azure-event-hub/iot_devices_new.png
Click the "+ New" button;
image title
/images/azure-event-hub/save_device_id.png
In the pop-up window, enter the "Device ID" and click "Save";
image title
/images/azure-event-hub/your_devices.png
Great! You have successfully created your new device.
container
0 1
image title
/images/user-guide/integrations/azure-event-hub/container-1.png
In the Azure portal, click the "Storage account";
image title
/images/user-guide/integrations/azure-event-hub/container-2.png
Go to the "Containers" page of the "Data storage" section. Here you will find the container. Save its name.
connection-string
0
image title
/images/user-guide/integrations/azure-event-hub/storage-connection-string-1.png
To find the storage connection string values, navigate to the "Access keys" page in the "Security + networking" section.
event-hub-compatible-endpoint
0 1
image title
/images/azure-event-hub/built_in_endpoints.png
In the Azure portal, navigate to the "IoT Hub" resource, and open the "Built-in endpoints" page from the context menu;
image title
/images/azure-event-hub/event_hub_compatible_endpoint.png
Copy and save the "Event Hub-compatible endpoint" value.
rule-chain-generator-node
0
image title
/images/user-guide/integrations/azure-event-hub/test-azure-event-hub-integration-1-pe.png
Go to the "<b>Rule chains</b>" page and select one of your rule chains. In the search nodes field, type &#39;gen&#39; to find the <b>generator</b> node in the menu. Drag it onto the canvas. In the pop-up window, specify the <b>name</b> of the generator, the <b>number of messages</b>, and the <b>generate function</b> (you can use our example). Finally, click "<b>Add</b>";
primary-key
0 1
image title
/images/azure-event-hub/your_devices.png
Now, find the device&#39;s <b>Primary key</b>. Go to the Azure portal, navigate to the <b>IoT devices</b> tab, and select your device;
image title
/images/azure-event-hub/primary_key.png
Locate the "<b>Primary key</b>" field. Copy and save it for later use.
rule-chain-iot-node
0
image title
/images/user-guide/integrations/azure-event-hub/test-azure-event-hub-integration-2-pe.png
Return to your ThingsBoard instance. We need to find another rule node. Type &#39;iot&#39; in the search nodes field and select the <b>azure iot hub</b> node. Drag it onto the canvas. In the pop-up window, specify the <b>node name</b>, replace <b>&#60;device_id&#62;</b> in the <b>Topic</b> with your Device Name, and enter the <b>Hostname</b> by retrieving it from the "<b>IoT Hub</b>" resource in the Azure portal. Enter the Device Name as the <b>Device ID</b> and add the <b>SAS Key</b> (<b>Primary Key</b>) that we previously copied from the device credentials. If you need to monitor events, enable Debug mode;
link-generator-iot-nodes
0
image title
/images/user-guide/integrations/azure-event-hub/test-azure-event-hub-integration-3-pe.png
Connect the <b>generator</b> to the <b>azure iot hub</b>. Tap on the right grey circle of "<b>generator</b>" node and drag this circle to the left side of the <b>azure iot hub</b> node. Select the "<b>Success</b>" link and click "<b>Add</b>". <b>Save</b> the rule chain, and go to the integration;
event-uplink
0
image title
/images/user-guide/integrations/azure-event-hub/test-azure-event-hub-integration-4-pe.png
Go to the "<b>Integrations</b>" page and select your <b>Azure Event Hub integration</b>. If you see a message of type "Uplink" in the "Events" section of your integration, everything is working correctly.
event-hub-compatible-name
0
image title
/images/azure-event-hub/event_hub_compatible_name.png
Open the Azure portal and navigate to the "IoT Hub" resource. Go to the "Built-in endpoints" page from the context menu. Find and copy the value of "Event Hub-compatible name" — this represents the IoT Hub name.
adding-downlink-converter
0 1 2 3
image title
/images/user-guide/integrations/azure-event-hub/adding-azure-event-hub-downlink-converter-1-pe.png
Navigate to the "Integrations" page, select the Azure Event Hub integration to open its details, and click the "pencil" icon to enter editing mode;
image title
/images/user-guide/integrations/azure-event-hub/adding-azure-event-hub-downlink-converter-2-pe.png
Provide a name for the downlink data converter and click "Create new converter";
image title
/images/user-guide/integrations/azure-event-hub/adding-azure-event-hub-downlink-converter-3-pe.png
Paste the required script into the Encoder function section. Click "Add";
image title
/images/user-guide/integrations/azure-event-hub/adding-azure-event-hub-downlink-converter-4-pe.png
In the advanced settings, add the "IoT Hub name" in the corresponding field. Click "Apply changes" to save the configuration.
device_groups_all
0 1
image
/images/azure-event-hub/device_groups_all_device profile.png
image
/images/azure-event-hub/device_profiles_rule_chain.png
downlink_rule_node
0 1
image
/images/azure-event-hub/add_rule_node_integration_downlink.png
image
/images/azure-event-hub/rule_chain_attributes_updated_and_downlink.png
device_last_part
0 1
image
/images/azure-event-hub/add_shared_attributes.png
image
/images/azure-event-hub/integrations_events_downlink.png
advanced_testing
0 1 2 3
image
/images/azure-event-hub/iot_integration_first.png
image
/images/azure-event-hub/iot_integration_second.png
image
/images/azure-event-hub/uplink_received.png
image
/images/azure-event-hub/uplink_message.png
downlink_result
0
image
/images/azure-event-hub/azure_cloud_to_device_message_count.png
solution_templates
0
image
/images/user-guide/integrations/use-solution-templates.png

{% assign docsPrefix = "pe/" %} {% include get-hosts-name.html docsTag="pe" %} {% include docs/pe/user-guide/integrations/azure-event-hub.md %}