3

Recently I've created an Azure IoT Hub and try to send telemetry message from hardware sensor to IoT Hub then to 1 function app to do post-data processing then to storage. It is a simple flow, however, in order to proceed post-data processing, I always have to connect to another API to gather information from that API, mapped the data with the telemetry message in the function app, then only proceed to storage.

Is there any other way to reduce the dependencies or reduce the calls to the API in this case? The hardware does not know anything other than sending the measurements. When it goes through IoT Hub, it will send to a Service Bus, then SB will trigger a Function App who responsible to call the API and do post-data processing including ID mapping then only store into DB.

I found out Azure IoT Hub has a feature called Message Enrichment that allows me to add the info into Device Twin and stamped to the telemetry message. However, Device Twin have a size limitation of 8Kb on the 'tags' field. The info I want to stamp might be larger than that.

Is there any other better way than this? Thank you if anyone knows for a better solution or how's this being handled in a common situation.

Sivvie Lim
  • 784
  • 2
  • 14
  • 43
  • 1
    Azure Stream Analytics would be an option if you can pull all the data from that API into one or more tables then use JavaScript user-defined functions to craft your logic if you can't do it with simple joins. Unfortunately user-defined functions can't make calls to 3rd party APIs, see https://learn.microsoft.com/en-us/azure/stream-analytics/stream-analytics-javascript-user-defined-functions#javascript-user-defined-functions. I don't see anything wrong with your current approach though, maybe use a Redis cache so you don't hammer the external API for data you already pulled in? – evilSnobu Dec 12 '19 at 06:20
  • @evilSnobu Sorry for the late reply as I'm not around for the past 3 days. I already edited the question to be more specific. – Sivvie Lim Dec 16 '19 at 03:19
  • The ASA supports input knows as *reference data*, see more details about this feature in the https://learn.microsoft.com/en-us/azure/stream-analytics/stream-analytics-use-reference-data and usage example: https://learn.microsoft.com/en-us/stream-analytics-query/reference-data-join-azure-stream-analytics – Roman Kiss Dec 16 '19 at 07:25

0 Answers0