0
votes

I have devices sending data to an Azure IoT hub regularly (Not Azure Event hub).

I am trying to write something in Python running on the cloud which waits for these events / messages to arrive and then store data in a database.

There are classes and APIs for the Azure Python SDK which consume data from Event Hubs such as EventHubConsumerClient.receive

However. I am limited to just using an IoT hub in this case.

What can I do to consume / ingest data from an Azure IoT hub? I'm a little bit lost with this. Thanks in advance.

1

1 Answers

2
votes

An IoT Hub uses an Event Hub under the hood and exposes an endpoint for that:

IoT Hub exposes the messages/events built-in endpoint for your back-end services to read the device-to-cloud messages received by your hub. This endpoint is Event Hub-compatible, which enables you to use any of the mechanisms the Event Hubs service supports for reading messages.

See the docs on this topic.

So this means you can use the Azure SDK for Python to read data using the Event Hub classes. To get started follow this Python based tutorial.