Forum Discussion

LeonBam's avatar
LeonBam
Copper Contributor
Feb 09, 2023

Files from IoTHub in storage are not JSON

Hello,

In my IotHub, I defined entrypoint for storage. 

While I see that the files are arrive successfully, the type of them is not JSON and I defied.

The content is JSON, but the extension is empty and not JSON as I used to have.

 

What can i define wrong this time?

Thanks  

 

3 Replies

  • harry_liou's avatar
    harry_liou
    Copper Contributor
    In my python case,
    Should use get_storage_info_for_blob function with extension:
    storage_info = await device_client.get_storage_info_for_blob("folder/file.json")
    FYR
    • LeonBam's avatar
      LeonBam
      Copper Contributor

      harry_liou 

      I will add images to clarify my case:

      Here is one definition:

      Here what I see now:

      I am missing the json extension, whereas the content is really new-line delimited json, same as above.  

      • LeonBam's avatar
        LeonBam
        Copper Contributor
        I found what I defined wrong. When using az cli, for creating route endpoint
        az iot hub routing-endpoint create , the --file-name-format should contains also the extension.
        I expected from it to use the --encoding parameter for this, but I had to add it myself.

Resources