Azure IOT Apache Avro格式 [英] Azure IOT Apache Avro format
问题描述
使用Azure IOT,我的设备端点指向Azure Blob存储.数据被发送到Blob,但是我得到了非ASCII字符,并被告知文件扩展名不正确.样本Blob数据为
Using Azure IOT, I have my device endpoint pointing to Azure Blob storage. Data is sent to the Blob, but i get non-ascii characters and am told that the file extension is incorrect. Sample Blob data is
Objavro.codecnullavro.schemaÐ{"type":"record","name":"Message","namespace":"Microsoft.Azure.Devices","fields":[{"name":"EnqueuedTimeUtc","type":"string"},{"name":"Properties","type":{"type":"map","values":"string"}},{"name":"SystemProperties","type":{"type":"map","values":"string"}},{"name":"Body","type":["null","bytes"]}]} ±¡RëZË8耑,¡…$•
à82018-02-20T15:12:16.1060000Z $connectionDeviceIdLane4Free(connectionAuthMethodœ{"scope":"device","type":"sas","issuer":"iothub","acceptingIpFilterRule":null}8connectionDeviceGenerationId$636543931333384343enqueuedTime82018-02-20T15:12:16.1060000Z d{"deviceId": "myPythonDevice","PinsCCC": 302.00,\}82018-02-20T15:12:16.2000000Z
Objavro.codecnullavro.schemaÐ{"type":"record","name":"Message","namespace":"Microsoft.Azure.Devices","fields":[{"name":"EnqueuedTimeUtc","type":"string"},{"name":"Properties","type":{"type":"map","values":"string"}},{"name":"SystemProperties","type":{"type":"map","values":"string"}},{"name":"Body","type":["null","bytes"]}]} ±¡RëZË8耑,¡…$•
à82018-02-20T15:12:16.1060000Z $connectionDeviceIdLane4Free(connectionAuthMethodœ{"scope":"device","type":"sas","issuer":"iothub","acceptingIpFilterRule":null}8connectionDeviceGenerationId$636543931333384343enqueuedTime82018-02-20T15:12:16.1060000Z d{"deviceId": "myPythonDevice","PinsCCC": 302.00,\}82018-02-20T15:12:16.2000000Z
Azure IOT文档说该格式为Apache Avro,但是我对如何解码非ASCII字符一无所获.我看不到在哪里指定json扩展名.
Azure IOT docs says that the format is Apache Avro, but I can't find anything on how to decode the non-ascii characters. I don't see where to specify a json extension.
推荐答案
似乎按设计.
您可以利用Avro工具读取或转换为JSON格式.
You can utilize Avro tool to read or convert to JSON format.
这是一个 Python示例读取Avro文件.
Here is a Python sample to read Avro file.
这篇关于Azure IOT Apache Avro格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!