A Blazor WASM App for periodically monitoring messages sent to an Azure IoT Hub … The service periodically polls the Hub for messages and queues them as instances of the Sensor class. The client separately periodically performs an Http GET to the service to get instances from the queue and display them as a list.

GitHub Repository: djaus2/BlazorD2CMessages

The app is based upon the Azure IoT HUb SDK read-d2c-messages .NET Core Sample

Monitor IoT Hub


Usage

Monitored messages need to encapsulate Sensor Class data: BlazorD2CMessages/Shared/Sensor.cs as on GitHub. These are the messages sent by Blazor Simulated Azure IoT Hub Device with Sensors as covered in the previous post.

Need to set several the Hub Connection strings in server/appsettings.json:

  • SHARED_ACCESS_KEY_NAME
  • EVENT_HUBS_SAS_KEY
  • EVENT_HUBS_COMPATIBILITY_ENDPOINT
  • EVENT_HUBS_COMPATIBILITY_PATH

Nb: The PowerShell app on GitHub at djaus2/az-iothub-ps can generate a complete appsettings.json file of all the connection settings for an IoT Hub. It can also quickly generate an IoT Hub, device etc.


Next: GPIO and Bindings App.


 TopicSubtopic
  Next: > Blazor-IoT
<  Prev:   Blazor-IoT
This Category:Blazor
  Next: > Blazor-IoT Azure IoT Hub Interaction using Blazor on a RPi - GPIO and Bindings App 
<  Prev:   Blazor-IoT