Input file to Azure Stream analytics in Json format error while previewing

N2120 81 Reputation points
2024-02-21T16:04:44.08+00:00

Thanks for your time, I have a job in azure stream analytics with an input json format file which is accessed through Azure data lake. the format of json is of format [{"tag": {"id":"1234","name":"viv","date":2020-01-01"}}] and when I run the query locally for hours , I do not see the input events getting ingested. User's image

the json file is of gz format and has the below

"Serialization": {
    "Type": "Json",
    "Encoding": "UTF8"
},

I try to preview data and I get the error

SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
Make sure the input has recently received data and the correct format of those events has been selected.

can you pls advice if the how the file can be ingested

Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
330 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wilko van de Velde 2,226 Reputation points
    2024-02-22T07:31:00.6433333+00:00

    Hello @N2120 ,

    The (input) JSON you provided has not the correct syntax, this should be:
    [{"tag": {"id":"1234","name":"viv","date":"2020-01-01"}}]

    There was a quote missing before the date. This could be a typo, so I'm not sure if this solves your problem.

    Therefore I tried to recreated your setup with a storage account and a stream analytics job. I saved just a regular JSON (without compression) to the storage account:

    User's image

    Next, I created a input in stream analytics:

    User's image

    When then looking at the preview of the input the content is shown:

    User's image

    So, try to save an example file in JSON into your storage account and test the setup with that file. If this works, this might indicate there is something wrong with the compression.

    Hope this will help.

    Kind Regards,

    Wilko


    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members. If you have extra questions about this answer, please click "Comment".