我有一个运行python的azure函数。它是由iothub / eventhub的传入消息触发的。
要访问消息正文,请用功能代码编写:
receivedBody = str(open(environ['myEventHubMessage']).read())
我的绑定如下:
{
"bindings": [
{
"type": "eventHubTrigger",
"name": "myEventHubMessage",
"path": "samples-workitems",
"consumerGroup": "nonDefault_1",
"connection": "xyz_events_IOTHUB",
"cardinality": "one",
"direction": "in"
}
],
"disabled": false
}
有没有一种方法可以直接获取deviceId和message-properties(例如ReceivedBody)?
类似:
deviceId = str(open(environ['deviceId']).read())
properties = str(open(environ['properties']).read())