Azure Iot Hub Receiver
    • Dark
      Light

    Azure Iot Hub Receiver

    • Dark
      Light

    Article summary

    The iothub data receiver reads data from the Azure Iot Hub with a built-in event hub endpoint. Metadata including application properties and the time that the data has been saved to the iot hub will be included.

    Example:

    {
        "data_receiver": [
            {
                "connections": [
                    {
                        "connection_string": "Endpoint=...;SharedAccessKeyName=...;SharedAccessKey=...;EntityPath=...",
                        "event_hub_name": "event-hub-x",
                        "start_datetime": "2022-11-01T00:00:00"
                    }
                ],
                "data_receiver_name": "my_iothub_receiver",
                "poll_interval": 10,
                "protocol": "iothub",
                "streams": [
                    {
                        "asset": "asset1",
                        "stream_type": "stream_type",
                        "device_id": "device-1"
                    },
                    {
                        "asset": "asset2",
                        "stream_type": "stream_type",
                        "device_id": "device-2"
                    }
                ]
            }
        ]
    }

    Configuration:

    Required and optional properties that can be configured for an Iot Hub receiver:

    • connections: How to connect to an Iot Hub server and retrieve tags. A connection has the following configurable settings:
      • connection_string: Represents all the needed connection info. The iot hub has a built-in “Event Hub compatible endpoint” which you can copy from.
      • event_hub_name: Name of the event hub
      • start_datetime: Initial datetime for data we want to fetch. Default is earliest datetime possible.
      • max_buffer_size: Max size of buffer for data to be pushed.
      • transport_type Transport type that will be used to communicate with EventHub. Allowed options are amqp (port 5671), amqp_websockets (port 443). Defaults is amqp.
      • consumer_group The consumer group used for iot hub to retrieve data from partitions. Default is ‘$Default’.
    • streams: Each input stream has the following configurable settings:
      • asset: Asset identifier
      • stream_type: Type of data stream
      • device_id: Name of the edge device id on the iot hub.
      • payload_field The name of the field to fetch data from. Default field name is “payload.” Useful only for fetching one-layer nested fields.
      • unpack_array If the iothub message or specified ‘payload_field’ in the message is an array, use this option to unpack the array. Defaults to True
    • poll_interval: The number of seconds to wait between attempts to push buffered data to the next stage.