如何在 Eventhub 上以 CSV 格式发送数据以用于 Azure 流分析?

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

我正在使用 Azure 流分析,我的输入是 Eventhub,事件序列化格式是 CSV,分隔符是逗号 (,)。我的查询是 select DeviceId,输入的温度,我的输出是 sql 数据库。 但是当我的工作是 运行 时,它会给我错误

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

和 第二个错误是

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

1) Malformed events

2) Input source configured with incorrect serialization format..

我正在像这样在 Eventhub 上发送数据

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

您当前的 CSV 格式是错误的,因为您需要在第一行指定列名,并在以下行中指定相关值:

DeviceID,Temperature
20,30

保罗