File Upload from Cloud to Azure IoT Edge Device

Amol Ingale 21 Reputation points
2022-08-18T03:59:09.38+00:00

Hi All,

Hope you all doing well,
I am looking to get some pointers in solutioning.
Problem Statement:--
On the IoT Edge Gateway or an Edge Device where modules are running as containers along side Edge Hub and Edge Runtime.
I need to get the modules reload when it gets a new file (this is quite achievable via Microsoft.Extensions.Configuration) but most important for me is to find a way to push a file on the Edge device from Cloud, please note this is not something from device to Cloud where there are solutions available like IOT Hub File upload but instead the requirement is other way round.

Could you provide some inputs on it????

Appreciate !!!

Kr.
Amol

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
382 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
541 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,124 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
208 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde 28,711 Reputation points MVP
    2022-08-18T21:44:36.04+00:00

    Hello @Amol Ingale ,

    So you want to have files being copied from cloud to edge.

    In general, devices should only make outbound connections.

    So, you cannot expose an inbound endpoint but some logic on the edge needs to be executed so it gets retrieves the file.

    On the other hand, exposing a file to be downloaded from anywhere in the world without security is also not handy.

    A few scenarios occur:

    • a module gets a desired property as a trigger to download a file from Azure blob storage (it needs storage credentials like a sas token from a blob)
    • a module gets a desired property as a trigger to download a file exposed by eg an Azure Function (again credentials need to be shared)

    Because the IoT Edge device already has a secure 'channel' with the cloud it can request and exchange (temporary) secrets in many ways (sending telemetry request, direct methods, cloud messages, )

    ----------

    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. By doing so, all community members who have a similar issue will benefit. Your contribution is highly appreciated.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. chbeier 1,866 Reputation points
    2022-08-19T13:08:51.93+00:00

    Besides the scenarios Sander mentioned, you might implement a direct method "downloadMe" on the device and call it from your cloud app with the SAS URI as payload. The benefit is immediate response on execution and control to your cloud app when the download should happen.

    While the maximum payload size of 120KB should be sufficient in most cases, review the throttling limits. IoT Hub S1 supports at max 40 direct method calls per second (160KB/sec/unit).

    0 comments No comments