2017-02-23 18 views
1

我有以下函數定義。Azure函數綁定:獲取EventData和強類型消息

消息類型:

type MailboxItem = { 
    CustomerID: int 
    AssetID: int 
} 

代碼:

let Run(item: MailboxItem, userNames: string, log: TraceWriter) = 
    log.Verbose("F# function executing for " + item.AssetID.ToString()) 

而且function.json

{ 
    "bindings": [ 
    { 
     "type": "eventHubTrigger", 
     "name": "item", 
     "direction": "in", 
     "path": "eventhubpath", 
     "connection": <connection>, 
     "consumerGroup": "$Default" 
    }, 
    { 
     "type": "blob", 
     "name": "userNames", 
     "path": "blobpath/{CustomerID}-{AssetID}", 
     "connection": <connection>, 
     "direction": "in" 
    } 
    ], 
    "disabled": false 
} 

正如你所看到的,我使用的傳入消息的屬性的綁定從Blob存儲輸入blob。

現在,我需要擴展我的功能,通過EventData類(例如序列號)訪問傳入消息的某些元數據。是否可以添加EventData參數,但是還要將綁定保留到消息正文的屬性中?

回答

2

目前還沒有,不幸的是,雖然這是一個常見的問題,我們正在追蹤我們的回購here,並希望能很快到達。在我們這樣做之前,它是一個/或 - 您可以綁定到EventData或您的自定義POCO。