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
參數,但是還要將綁定保留到消息正文的屬性中?