how to use ELMS to upload module logs to blob

Mistyron 25 Reputation points
2024-12-02T17:37:18.63+00:00

Please see the reported issue on Azure-Samples GitHub: https://github.com/Azure-Samples/iotedge-logging-and-monitoring-solution/issues/36

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,003 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,222 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 27,446 Reputation points
    2024-12-05T17:42:25.17+00:00

    To upload IoT Edge module logs to Azure Blob Storage using the IoT Edge Logging and Monitoring Solution (ELMS), follow these steps:

    1. Generate a SAS URL for Your Blob Storage Container:
      • In the Azure portal, navigate to your storage account.
      • Go to the Containers section and select the container designated for log storage.
      • Click on Generate SAS to create a Shared Access Signature (SAS) URL. This URL grants the necessary permissions for uploading logs to the container.
    2. Invoke the UploadModuleLogs Method:
      • In the Azure portal, access your IoT Hub and select the relevant IoT Edge device.
      • Under Direct Methods, choose InvokeUploadModuleLogs.
      • Provide the SAS URL in the payload. This action will prompt the device to upload its logs to the specified Blob Storage container.
    3. Automate Log Uploads:
      • To schedule regular log uploads, utilize the ScheduleUploadModuleLogs method.
      • This can be achieved by setting up a timer-triggered Azure Function that periodically calls InvokeUploadModuleLogs.

    Link : https://learn.microsoft.com/en-us/answers/questions/2123684/%28duplicate%29-elms-how-to-save-module-logs-to-blob-s

    0 comments No comments

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.