如何解决我的来自IoT设备的消息正文无法通过vscode/local通过azure函数接收的问题

问题描述 投票:0回答:0

如何解决这个错误?当我的传感器检测到人员并尝试将数据发送到云端时,会出现此错误。 error read body from azure function

错误文字: 这是结果: [2024-01-10T09:57:10.295Z]执行“Functions.AutomateHubTrigger”(原因=“(null)”,Id=d286be5c-f5e8-4260-9c9e-a6e27de9b87c) [2024-01-10T09:57:10.300Z]触发器详细信息:PartionId:1,偏移量:4294979360,EnqueueTimeUtc:2024-01-10T09:55:47.2540000+00:00,SequenceNumber:110,计数:1 [2024-01-10T09:57:10.306Z] 正文类型:,正文内容:[{'id': 'f6acfe2e-8725-2b54-777d-79b477db2796', 'topic': '/SUBSCRIPTIONS/D0E3660E- 537C-4385-89F5-B2B0646AF52A/RESOURCEGROUPS/AUTOMATE/PROVIDERS/MICROSOFT.DEVICES/IOTHUBS/AUTOMATE-HUB','主题':'设备/自动设备-id','eventType':'Microsoft.Devices.DeviceTelemetry' , 'data': {'properties': {}, 'systemProperties': {'iothub-connection-device-id': 'automate-device-id', 'iothub-connection-auth-method': '{"范围“:“设备”,“类型”:“sas”,“发行者”:“iothub”,“acceptingIpFilterRule”:null}','iothub-connection-auth- Generation-id':'638364984370269801','iothub-enqueuedtime ': '2024-01-10T09:55:47.0870000Z', 'iothub-message-source': '遥测'}, 'body': 'eyJkYXRlIjogIjIwMjQtMDETMTAiLCAidGltZSI6ICIxNjo1NTo0NiIsICJ0ZW1wZXJhdHVyZSI6 IDM0LjAsICJwZW9wbGUiOiAwfQ=='},'数据版本':'','元数据版本': '1', '事件时间': '2024-01-10T09:55:47.087Z'}] [2024-01-10T09:57:10.310Z] 执行“Functions.AutomateHubTrigger”(失败,Id=d286be5c-f5e8-4260-9c9e-a6e27de9b87c,持续时间=15ms) [2024-01-10T09:57:10.314Z] System.Private.CoreLib:执行函数时出现异常:Functions.AutomateHubTrigger。 System.Private.CoreLib:结果:失败 异常:类型错误:列表索引必须是整数或切片,而不是 str 堆栈:文件“C:\Users\Viqram Wataf\AppData\Roaming 虚拟机10.24.0 \workers\python .9\WINDOWS\X64 zure_functions_worker\dispatcher.py 中的 ode_modules zure-functions-core-tools",第 406 行,在 _handle__invocation_request 中 call_result = 等待 self._loop.run_in_executor( 文件“C:\Program Files\Python 3.9.0\li

azure azure-functions azure-iot-hub
© www.soinside.com 2019 - 2024. All rights reserved.