Search code examples
jsonazure-stream-analytics

Azure Stream Analytics Error :Could not deserialize the input event as Json


I am trying to create a Stream Analytics job. The message is being sent in the following format as JSON:

var message = "Name;\n" + Guid.NewGuid().ToString() + ";" ;

When I am running my job I am getting the following error:

Could not deserialize the input event as Json. Some possible reasons: 
1) Malformed events 
2) Input source configured with incorrect serialization format

Solution

  • Based on your code sample, it appears your input is taking the form of:

    Name;
      AA7509E7-D482-459B-9689-456A0F952B44;
    

    then the error message you're seeing is correct, this is not valid JSON, so ASA won't be able to deserialize it. Your JSON string should look something like this:

    {
      "Name": "AA7509E7-D482-459B-9689-456A0F952B44"
    }