Recently I've been struggling on how to reduce dependencies of my Function App. I would like to reduce some dependencies to the database (and also its authorization).
So I thought of putting some data that needed by Function App in the Device Twin as the telemetry message will go through IoT Hub then reaching the Function App, and by putting them in Device Twin I could use Message Enrichment to stamp them into properties of the telemetry message.
The data needed for each device might be big or small. However recently I found out device twin have size limits at 32KB for properties and 8KB for tags. For some device it might exceed the limit.
Other than this, I also found out a way to extend the device twin by using blob storage. But wouldn't that be a repetition of storage? (No matter its in blob storage or redis cache).
I would like to ask community if there is other way to let my Function App have those data (without connect to database) and not having repetition of storage options.
Thank you.
These are really two questions: 1. How to extend the Device Twin 2. How to feed my Function data that's not in the Device Twin without having to look it up
If I read your issue correctly, you are looking for a solution to the second problem. There is a solution for it:
You can add data to the message in between the IoT Hub and the Function App by using Stream Analytics. Stream Analytics has a reference data option that you can use to join to the message before sending it as the output. This means your Function won't have to go to the database to get the data, and you don't have to duplicate your storage. Your Stream Analytics job will have an IoT Hub as input and your Function as an output. The query joins the reference data from the database to the message coming in and use that as the output.