Storing the device sensor data that is sent to the IoT Hub can be stored either into a Blob or into a Storage Table. Saving in a Table is more easy to comprehend. The process is as follows:

 

  1. Create an Azure Function App named esm-device-msgs2table-appattached to an Azure Storage account named esmiotstorage.
  2. Then created an Event Hub Namespace named esm-event-hub-ns.
  3. In this namespace created an Event Hub named esm-event-hub.
  4. Then created Azure Function code as follows:
    1. Go to the function app created earlier.
    2. Click on Add New Function.
    3. Selected Custom Function link (at the bottom of the page)
    4. Then select the tile named Event Hub Trigger - C#.
    5. Set the name of the function as StoreDeviceMsgs2Table.
    6. Set the other parameters and click Create.

 

This function is supposed to pick the all messages and store in a table. But it was not doing that. This also need to be debugged. If this picks up all the messages and stores in the table, then this table can be read through a .NET app and displayed as historical data.