Notify uploaded file using System-assigned authentication type

Antonio Toga 95 Reputation points
2024-06-13T16:44:12.25+00:00

How can I notify the upload file using system-assigned authentication type?

I have an IoT hub using system-assigned authentication type and connected to a storage account with a private endpoint. I uploaded the file using python, and the upload was successful. If I look for the file, I can find it in the storage account. I want to notify the upload, but I got an error message related to an invalid blob name. I tried to use the same code but with a different IoT hub and different authentication type. If I use key-based authentication, I don't get that error; I only get that error if I use system-assigned authentication. I need to use the system-assigned authentication due to policies. Also, my code is in Python, and I tried using C# and I tried to make a request to the API directly and got the same message.

DEBUG:azure.iot.device.iothub.pipeline.http_pipeline:HTTPPipeline notify_blob_upload_status called

DEBUG:azure.iot.device.common.pipeline.pipeline_thread:Starting run_op in pipeline thread

DEBUG:azure.iot.device.iothub.pipeline.pipeline_stages_iothub_http:IoTHubHTTPTranslationStage(NotifyBlobUploadStatusOperation): Translating Get Storage Info Operation to HTTP.

DEBUG:azure.iot.device.common.pipeline.pipeline_stages_http:HTTPTransportStage(HTTPRequestAndResponseOperation): Generating HTTP request and setting callback before completing.

DEBUG:azure.iot.device.common.pipeline.pipeline_thread:Starting request in azure_iot_http thread

INFO:azure.iot.device.common.http_transport:sending https POST request to devices/jp-test-1000/files/notifications .

DEBUG:urllib3.connectionpool:https://dasbot-iothub-stage.azure-devices.net:443 "POST /devices/jp-test-1000/files/notifications?api-version=2019-10-01 HTTP/1.1" 400 295

DEBUG:azure.iot.device.common.pipeline.pipeline_thread:Starting on_request_completed in pipeline thread

DEBUG:azure.iot.device.common.pipeline.pipeline_stages_http:HTTPTransportStage(HTTPRequestAndResponseOperation): Request completed. Completing op.

DEBUG:azure.iot.device.common.pipeline.pipeline_stages_http:HTTP Response Status: 400

DEBUG:azure.iot.device.common.pipeline.pipeline_stages_http:HTTP Response: {"Message":"{"errorCode":400020,"message":"Blob name \"jp-test-1000/fileToTest.json\" is invalid","trackingId":"1A13BA61507B41DCAA0F55F922435C1B-G2:-TimeStamp:2024-06-13T16:10:48.631689740Z","timestampUtc":"2024-06-13T16:10:48.631689740Z","info":null}","ExceptionMessage":""}

DEBUG:azure.iot.device.common.pipeline.pipeline_ops_base:HTTPRequestAndResponseOperation: completing without error

DEBUG:azure.iot.device.iothub.pipeline.pipeline_stages_iothub_http:IoTHubHTTPTranslationStage(HTTPRequestAndResponseOperation): Got response for GetStorageInfoOperation

DEBUG:azure.iot.device.common.pipeline.pipeline_ops_base:NotifyBlobUploadStatusOperation: completing with error HTTP operation returned: 400 ArgumentError(Error: Bad Request)

DEBUG:azure.iot.device.common.pipeline.pipeline_thread:Starting on_complete in callback thread

INFO:azure.iot.device.common.evented_callback:Callback completed with error HTTP operation returned: 400 ArgumentError(Error: Bad Request)

INFO:azure.iot.device.common.evented_callback:NoneType: None

Code:

User's image

Code making API Request:

User's image

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
400 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,198 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
222 questions
0 comments No comments
{count} votes

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.