Tag: avro

如何使用c#读取在blob中捕获的事件中心日志数据

我有simple logic app , creates a text file 我想test whether the logic app created file is present in file storage 。 并且还想测试correlation id of logic app的correlation id of logic app的值 我创建了Event Hub和In Logic app configure Diagnostic Settings to Stream to an event hub 。 现在Inside Event hub I have configure Capture option to Azure Storage […]

使用C#反序列化Avro文件

我找不到用C#反序列化Apache Avro文件的方法。 Avro文件是Microsoft Azure Event Hub中的存档function生成的文件。 使用Java,我可以使用Apache的Avro Tools将文件转换为JSON: java -jar avro-tools-1.8.1.jar tojson –pretty inputfile > output.json 使用NuGet包Microsoft.Hadoop.Avro我能够提取SequenceNumber , Offset和EnqueuedTimeUtc ,但由于我不知道Body使用什么类型,因此抛出exception。 我尝试过使用Dictionary和其他类型。 static void Main(string[] args) { var fileName = “…”; using (Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) { using (var reader = AvroContainer.CreateReader(stream)) { using (var streamReader = new SequentialReader(reader)) { var record […]