简体   繁体   English

如何在不使用 Azure SignalR 服务的情况下从 Azure Function 发送 SignalR 消息

[英]How can I send a SignalR message from an Azure Function without using Azure SignalR Service

I have an older C# app that is being migrated to the cloud.我有一个旧的 C# 应用程序正在迁移到云中。 It uses SignalR, but only direct client/server connections.它使用 SignalR,但仅直接客户端/服务器连接。 No SignalR service is involved yet.目前还没有涉及SignalR业务。

I am extracting some processes that are well suited for an Azure function, but one feature I would prefer to not have to redesign for this MVP is a SignalR message back to the user that tells them the percent complete for this job.我正在提取一些非常适合 Azure function 的流程,但我希望不必为此 MVP 重新设计的一个功能是向用户返回一条 SignalR 消息,告诉他们这项工作的完成百分比。

I am reading the MS documentation from here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service-output?tabs=in-process&pivots=programming-language-csharp focusing on Isolated-Processes.我正在从这里阅读 MS 文档: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service-output?tabs=in-process&pivots=programming-language-csharp专注于隔离进程。

I can see how I can send messages to the Azure SignalR service, but I am unclear how I might be able to just send a message back to the caller.我可以看到如何将消息发送到 Azure SignalR 服务,但我不清楚如何才能将消息发送回呼叫者。

I would really like to set up a simple Hub and send messages directly to the client as the function progresses.我真的很想设置一个简单的集线器,并在 function 进行时直接向客户端发送消息。

I would suggest giving web pub sub a look?我建议给 web pub sub 看看? Microsoft has a good comparison article here .微软在这里有一篇很好的比较文章。 Summary, it is a bit more language agnostic, and if you're already using azure then it has less setup overhead than SignalR.总而言之,它与语言无关,如果您已经在使用 azure,那么它的设置开销比 SignalR 少。

https://dev.to/albertbe.nett/how-to-azure-pubsub-service-2ccb https://dev.to/albertbe.nett/how-to-azure-pubsub-service-2ccb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Function - 从事件中心触发器发送消息到 Azure Z358E3E185C2A6EEE5539F - Azure Function - Send a message from an Event Hub Trigger to an Azure SignalR Service 将SignalR与Azure Service Fabric一起使用 - Using SignalR with Azure Service Fabric 如何验证从 Angular 应用程序与 Azure 函数(协商)建立的连接,该应用程序又与 Azure SignalR 服务连接? - How to authenticate the connections made to Azure Function (negotiate) from angular application which in turn connects with Azure SignalR Service? SignalR Azure 服务开发 - SignalR Azure Service Development SignalR HubConnection 未从无服务器接收消息 Azure SignalR 服务 - SignalR HubConnection not receiving messages from serverless Azure SignalR service .Net客户端可以与azure signalR服务通信吗? - Can .Net Client communicate with azure signalR service? Azure Signalr + Azure函数+ wpf客户端-如何使用azure函数和自托管的Azure SignalR App创建wpf客户端应用程序 - Azure Signalr +Azure function + wpf client - how to have a wpf client application using azure funtion and self hosted Azure SignalR App SignalR Core 未在 Azure 应用服务中使用 Websocket - SignalR Core not using Websockets in Azure App Service 如何在Signalr Azure Service中启用Cors - How to enable Cors in Signalr Azure Service SignalR:我可以分组发送消息给呼叫者吗? - SignalR: Can i send a message to the caller in a group?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM