![]() |
|
Azure SignalR Service now supports Event Grid! - Printable Version +- Sick Gaming (https://sickgaming.net) +-- Forum: Programming (https://sickgaming.net/forum-76.html) +--- Forum: C#, Visual Basic & .NET (https://sickgaming.net/forum-79.html) +--- Thread: Azure SignalR Service now supports Event Grid! (/thread-91925.html) |
Azure SignalR Service now supports Event Grid! - xSicKxBot - 09-10-2019 Azure SignalR Service now supports Event Grid! Ken August 8th, 2019 Since we GA’ed Azure SignalR Service in last September, serverless has become a very popular use case in Azure SignalR Service and is used by many customers. Unlike the traditional SignalR application which requires a server to host the hub, in serverless scenario no server is needed, instead you can directly send messages to clients through REST APIs or our management SDK which can easily be used in serverless code like Azure Functions. Though there is a huge benefit which saves you the cost of maintaining the app server, the feature set in serverless scenario is limited. Since there is no real hub, it’s not possible to respond to client activities like client invocations or connection events. Without client events serverless use cases will be limited and we hear a lot of customers asking about this support. Today we’re excited to announce a new feature that enables Azure SignalR Service to publish client events to Azure Event Grid so that you can subscribe and respond to them. How does it work? Let’s first revisit how serverless scenario in Azure SignalR Service works.
This flow is illustrated as step 1-3 in the diagram below: What’s missing here is that there is no equivalent of Code: OnConnected()Code: OnDisconnected()Now with Event Grid you’ll be able to get such events through an Event Grid subscription (as step 4 and 5 in the above diagram):
How to use it? It’s very simple to make your serverless application subscribe to SignalR connection events. Let’s use Azure function as an example.
Now you’re all set! Your function app is now able to get connection events from SignalR Service. To test it, you just need to open a SignalR connection to the service. You can use the SignalR client in our sample repo, which contains a simple negotiate API implementation.
Try it now! This feature is now in public preview so feel free to try it out and let us know your feedback by filing issues on Github. For more information about how to use Event Grid with SignalR Service, you can read this article or try this sample. Ken Chen Principal Software Engineering Manager Follow Ken https://devblogs.microsoft.com/aspnet/author/kenchenmicrosoft-com/feed/ |