Real Time Communication To Cross Platform Devices Using Azure SignalR Service - Part One

In this article, I will discuss how to do real-time communication between cross-platform devices, such as .NET Core web apps run in Azure, Xamarin-based Android app and Full .NET Framework-based Windows.Forms app running on Windows Operating System by sending and receiving data using Azure SignalR Service. In this two-part article series, I will create a tool called MagicPaste which will transfer the text content from one device to another in real time.

In my first part of the article, I will be covering the architecture of the Magic Paste Tool and how to set up the SignalR Service in Azure SignalR Portal. In my next part of the article, I will be developing the SignalR Client Web App, Android App and Windows Forms App to communicate with each other in real time using Azure SignalR Service. 

Android

Architecture
SignalR
Demo

Setting up Azure SignalR Service

 Microsoft recently released the preview version Azure SignalR Service which is a fully-managed service that allows developers to focus on building real-time web experiences without worrying about capacity provisioning, reliable connections, scaling, encryption or authentication. In this example, I set up the Azure SignalR Service with the Free Tier which allows the maximum of a single unit with 100 connections. This will be suffcient for this demo.

Steps to be followed
  • Login to Azure portal and click Create a Resource and Search for SignalR Service in the marketplace and click the "Create" button.
 SignalR
  • Enter the resource name, select the Subscription, Resource Group, and the Free Pricing Tier and then click the "Create" button.
 SignalR
  • We have now created the Azure SignalR Service succesfully. Navigate to the dashboard page of SignalR Service that we have created just now and copy the EndPoint URL with the accesskeys under the Keys Section. User Access Keys are used to authenticate SignalR clients when making a request to Azure SignalR Service. It is very important to keep these keys secure. During the development time, you can store the keys in the usersecrets.json file so that it will get checked in into source control by accident. When you deploy the SignalR Web Client App, you can deploy the keys into Azure Key Vault or AppSettings in Azure Web App Service. 
SignalR 
Conclusion

In this article, we learned how to setup the Azure SignalR Service. In my next article, we’ll focus on how to create SignalR Client Applications (Web App, Android App and Windows Forms App) and connect to Azure SignalR services to communicate each other by sending and receiving the data using Azure SignalR Service.

Happy Coding! 


Similar Articles