How to send data as CSV on Eventhub for Azure Stream Analytics?

3.7k views Asked by At

I am using Azure stream analytics and my input is Eventhub,EVENT SERIALIZATION FORMAT is CSV and DELIMITER is comma(,).My query is select DeviceId,Temperature from input and my output is sql database. but when my job is running it gives me error like

"After deserialization, 0 rows have been found. If this is not expected, possible reasons could be a missing header or malformed CSV input"

and second error is

Could not deserialize the input event as Csv. Some possible reasons:

1) Malformed events

2) Input source configured with incorrect serialization format..

and i am sending data on Eventhub like This

string messageBody1 = "DeviceID:20," + "Temperature:30";
ClientHelper.SendMessage(messageBody1).Wait();
1

There are 1 answers

3
ppatierno On BEST ANSWER

Your current CSV format is wrong because you need to specify column names on the first line and related values in the following lines as :

DeviceID,Temperature
20,30

Paolo