Azure函数使用nodejs获取服务总线brokeredMessage

时间:2017-02-22 08:14:47

标签: node.js azureservicebus azure-functions

有没有办法从javascript azure函数中检索服务总线代理消息。 目前,只有一个包含invocationId的上下文,但不包含所有属性,如brokeredProperties或customPropeties。

由于

2 个答案:

答案 0 :(得分:2)

目前,context.bindingData.properties对象中提供了所有Service Bus自定义属性。

就我而言:

properties: 
{ 
    type: 'sometype',   // <- this is the property I have set manually in IoT Device-to-Cloud message
    'iothub-connection-device-id': 'mydeviceid',
    'iothub-connection-auth-method': '{"scope":"somescope","type":"sometype","issuer":"external","acceptingIpFilterRule":null}',
    'iothub-connection-auth-generation-id': 'someid' // <- These are added by IoT Hub
}

答案 1 :(得分:1)

目前无法通过节点功能执行此操作。您必须使用C#并指定BrokeredMessage作为参数类型,在这种情况下,您将获得整个消息来处理自己。

提交一个问题是为了公开Service Bus(和Event Hub)触发器的更多详细信息:https://github.com/Azure/azure-webjobs-sdk/issues/1004。我已添加了此问题的链接,因此我们可以确保在解决问题时将您的方案考虑在内。