Sending big-sized messages to IoT hub, which pattern is architecturally correct?

Najam ul Saqib 440 Reputation points
2025-07-18T10:58:34.85+00:00

Hi,I have an edge device sending a request to IoT hub having 10MB size (because it contains base64 images) but this will burn the daily quota at a higher rate.

I thought of uploading the images from edge device first to the blob and then sending URLs in message to IoT hub but this approach will require separate management of edge device's authentication with function app to get SAS URL

The other option is, since edge device is sending in the request to IoT hub what if I send one request first to IoT hub that gets redirected to logic/func app to return the SAS token and then device uploads and returns the urls to IoT hub hence decreasing message size. This will be done by communicating with IoT hub with same connection string hence no additional management overhead if this is even possible.

Which approach sounds scalable to you? Open to other ideas as well.

EDIT: I have just come to know that each message has to be under 256KBs sent to IoT hub, therefore direct sending is never an option forget about burning the daily quota, correct me if I am wrong.

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

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 36,941 Reputation points MVP Volunteer Moderator
    2025-07-18T15:39:02.8333333+00:00

    Hello @Najam ul Saqib ,

    welcome to this moderated Azure community forum.

    Sending blobs to the cloud via an IoT Hub is a bit of a challenge.

    You will be charged in 4KB chunks with a maximum message size up to 256KB so 64 chunks.

    Both options is feasible. You need access to a blob storage container which is probably not publicly available. So, sending a request from the edge to an Azure function behind the IoT Hub that generates a SAS token (limited in time) is a valid approach. Make sure you mark these technical flow messages with eg. application properties so you can route them on the IoT Hub to a separate flow, not mixed with regular messages.

    An Event hub can only receive messages with a size up to 1 MB so this will not work in your case.

    Still, did you check out this blob storage module from Microsoft?

    It offers a smart way of copying files from the local disk to the cloud via Azure IoT Edge.

    The only drawback is that the secrets of the storage is kept in the device twin. This is not directly readable on the device but some administrators are less knowledgeable with this approach of sending properties to the edge.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


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.