Store MQTT messages IoT Hub

Andrea Previtali 106 Reputation points
2022-06-01T07:54:38.647+00:00

Hi all,

I'm moving my first steps into Azure world.

I'm trying to edit some of samples provided by Microsoft documentation.
I'm able to send MQTT messages to IoT Hub from different platforms.

Now I would to store this messages into a table.
In messages routing i created a rule to direct messages to a storage account.
Is this the correct way to proceed? Create a storage account and route messages to it?
I don't understand exactly what I have to do, do I have to create a function to store this messages?

Andrea

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,272 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Matthijs van der Veer 4,376 Reputation points MVP Volunteer Moderator
    2022-06-01T16:07:50.103+00:00

    You're on the right path! If you want to store the messages in blob storage, you can follow this tutorial. It will store the messages in your Azure Storage Account. This is a built-in feature of IoT Hub.

    However, you also mentioned:

    Now I would to store this messages into a table

    If by that you mean that you want to use table storage (available in CosmosDB or Storage Accounts), you will need to take a different approach. One such approach could be to use an Azure Function to listen to the IoT Hub built-in endpoint and use the CosmosDB/Storage Account SDK to put the messages in table storage.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.