你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。

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