Breadcrumbs

Step 6 Consume Data from IoTHub in Azure

IoTHub supports several ways to consume data.


IoTHub Client SDK


IoTHub provides you with a client libraries for all major languages to push and pull data from IoTHub see the link for more information: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks

Azure Cloud Services & BloB Storage


IoTHub has full integration with all major Azure Cloud services, in this section we will focus on BloB Storage.

AzureBlobStorage is a scalable, cost-effective cloud storage for all your unstructured data. Pay only for what you use, and save money compared with on-premises storage options. Choose from among four storage tiers, depending on how often you’ll access the data. Store performance-sensitive data in Premium, frequently accessed data in Hot, infrequently accessed data in Cool, and rarely accessed data in Archive.

  1. Go to your Azure Portal and click on on your IoTHub.

  2. In the left click on Message Routing.

    Screenshot 2019-07-10 at 10.41.24.png

  3. Then on the Custom endpoints tab.

    Screenshot 2019-07-10 at 10.42.25.png

  4. Click Add button to add a new custom endpoint (where the messages will be routed).

  5. And choose Blob Storage.

    Screenshot 2019-07-10 at 10.46.13.png

  6. Give a unique name to this endpoint.

    Screenshot 2019-07-10 at 10.48.46.png

  7. Pick a storage container.

    Screenshot 2019-07-10 at 10.52.02.png

  8. Click on + Storage Account.

    Screenshot 2019-07-10 at 10.53.04.png

  9. Give it a unique name and click OK.

    Screenshot 2019-07-10 at 10.59.35.png

  10. Then chose the storage account you created.

    Screenshot 2019-07-10 at 11.05.02.png

  11. And Create a container for data.

    Screenshot 2019-07-10 at 11.06.43.png

  12. Choose the container then hit Select.

    Screenshot 2019-07-10 at 11.08.23.png

  13. Choose the data format and click on create.

    Screenshot 2019-07-10 at 11.10.13.png

  14. Your endpoint is created.

    Screenshot 2019-07-10 at 11.15.36.png

  15. Now we will redirect all events to this endpoint.

  16. Go to the route tab and click add.

    Screenshot 2019-07-10 at 11.19.03.png

  17. Give your route a name. choose the endpoint we created and choose Device Telemetry Message then hit Save.

    Screenshot 2019-07-10 at 11.21.18.png

  18. Congratulation now, all the telemetry data are stored on the Azure Blob Storage.

  19. For devices/points tags follow the same procedure and in the data source option choose Device Twin Change Events.
    Screenshot 2019-07-10 at 11.39.27.png