WebPubSubTriggerOptions interface

屬性

clientProtocols

可選 - 指定可觸發 Web PubSub 觸發函數的用戶端協定預設為「all」

connection

可選 - 包含 Web PubSub Service 連接字串 的應用程式設定名稱。 若未指定,預設為「WebPubSubConnectionString」。

connections

選用 - 指定用於簽章驗證的上游 Azure Web PubSub 服務的應用程式設定或設定集合名稱若未指定,預設為「WebPubSubConnectionString」

eventName

必須 - 函式應回應的事件名稱 系統事件類型:'connect'、'connected' 或 'disconnected' 使用者自訂子協定:'message' 系統支援子協定 json.webpubsub.azure.v1:使用者定義事件名稱

eventType

必須 - 函式應回應的事件類型必須是「使用者」或「系統」之一

hub

必須 - 函式綁定所屬的集線器名稱

name

必要 - 函式程式碼中使用的變數名稱,用於接收事件資料的參數

屬性詳細資料

clientProtocols

可選 - 指定可觸發 Web PubSub 觸發函數的用戶端協定預設為「all」

clientProtocols?: "all" | "webPubSub" | "mqtt"

屬性值

"all" | "webPubSub" | "mqtt"

connection

警告

此 API 現已淘汰。

Use connections instead.

可選 - 包含 Web PubSub Service 連接字串 的應用程式設定名稱。 若未指定,預設為「WebPubSubConnectionString」。

connection?: string

屬性值

string

connections

選用 - 指定用於簽章驗證的上游 Azure Web PubSub 服務的應用程式設定或設定集合名稱若未指定,預設為「WebPubSubConnectionString」

connections?: string[]

屬性值

string[]

eventName

必須 - 函式應回應的事件名稱 系統事件類型:'connect'、'connected' 或 'disconnected' 使用者自訂子協定:'message' 系統支援子協定 json.webpubsub.azure.v1:使用者定義事件名稱

eventName: string

屬性值

string

eventType

必須 - 函式應回應的事件類型必須是「使用者」或「系統」之一

eventType: "user" | "system"

屬性值

"user" | "system"

hub

必須 - 函式綁定所屬的集線器名稱

hub: string

屬性值

string

name

必要 - 函式程式碼中使用的變數名稱,用於接收事件資料的參數

name: string

屬性值

string