Description:

Receives messages from a Microsoft Azure IOT Hub, writing the contents of the Azure message to the content of the Flow File.

Tags:

azure, Microsoft, cloud, IOT, streaming, streams

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property is considered “sensitive”, meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

Name

Default Value

Allowable Values

Description

IOT Hub Endpoint

sb://${servicenamespace}. servicebus.windows.net To support Namespaces in non-standard Host URIs (not.servicebus.windows.net, i.e. Service bus. chinacloudapi.cn) select from the drop down acceptable options

IOT Hub Name

The name of the Azure IOT Hub-compatible name

Shared Access Primary Key

The primary key of the IOT Hub Shared Access Policy 

Sensitive Property: true

Partitions

The number of partitions that the IOT Hub has. Only this number of partitions will be used, so it is important to ensure that if the number of partitions changes that this value be updated. Otherwise, some messages may not be consumed.
Enqueue Date YYYY-MM-DD A timestamp (ISO-8061Instant) formatted as YYYY-MM-DD (2016-01-01) from which messages should have been enqueued in the IOT Hub to start reading from.

Supports expression language: true

Relationships:

Name

Description

Failure Any FlowFile that is not received successfully from the Azure IOT Hub will be transferred to this Relationship.
Success Any FlowFile that is successfully received from the Azure IOT Hub will be transferred to this Relationship.

Read attributes:

None Specified

Write attributes:

Name

Description

eventhub.enqueued.timestamp The time (in milliseconds since epoch, UTC) at which the message was enqueued in the Azure Event Hub.
eventhub.offset The offset into the partition at which the message was stored.
eventhub.sequence The Azure Sequence number associated with the message.
eventhub.name The name of the Event Hub from which the message was pulled.
eventhub.partition The name of the Azure Partition from which the message was pulled.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input Requirements:

This component does not allow an incoming relationship.

How to get the property value from Azure Portal?

Get value for IOT Hub Endpoint, Hub Name and Partitions value

Step 1: Login into Azure IoT account by https://portal.azure.com/ with respected credentials.

Step 2: Choose your respected Azure IOT Hub in dashboard page.

Step 3: Type as Endpoints in search box, choose and select the Events from Built-in endpoints. It will show the value of partitions, Hub-compatible name and endpoint.

Example to take the value for hub endpoint in copied URL:

Only copy the hub endpoint as in bold format like below

Endpoint=sb://iothub-ns-testio-28516-1a234ebdf.servicebus.windows.net/;SharedAccessKeyName=iothubowner;SharedAccessKey=GAhyblkHa4sPCI+d+/aax4hHoAMg+0GfVGE0lYpaR9o=

Get value for Shared Access Primary Key:

Type as Shared access in search box, choose and select the iothubowner from POLICY. It will show the multiple value of shared access keys and copy first one for shared access primary key value.

How to fetch data from Microsoft Azure IOT Hub using Data Integration Platform?

In Data Integration Platform use “GetAzureIOTHub” Processor to get the data from Microsoft Azure IOT Hub. Here is the overview image for GetAzureIOTHub with success relationship.

Step 1: Drag “GetAzureIOTHub” processor in canvas page and pair with success relationship. If data is sent to destination or queued successfully, its moves into success relationship.

Step 2: Once note down all the property value from azure portal in user account, You must fill the value of required properties appear in bold. Other properties (not in bold) are considered optional.

Step 3: Once job is success and it has able to receive a message in Microsoft azure for requested hub, the relationship is fall into success.