This demo shows how to implement serverless real-time messaging using Azure Functions V2 with C# and Azure SignalR Service without requiring an ASP.NET Core backend.
Based on the bindings provided by Anthony Chu: https://github.com/anthonychu/AzureAdvocates.WebJobs.Extensions.SignalRService
- Create an Azure SignalR Service instance in the Azure Portal. Go to Keys and note the connection string, you'll need this later.
- Clone repository
- Add local.settings.json to the project and provide these values:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"AzureSignalRConnectionString": "Endpoint=INSERT_YOUR_SIGNALRSERVICE_ENDPOINT_HERE;"
},
"Host": {
"LocalHttpPort": 7071,
"CORS": "*"
}
}
- Start Debugging
- Clone repository
- Run npm install to install required dependencies
- Run ng serve to start local test server
- Open http://localhost:4200 in (multiple) browser windows
- type message and send
Please note that at least the Windows Fall Creators Update is required for this client as the Microsoft.AspNetCore.SignalR library requires .NETStandard 2.0 which was introduced to UWP with the Fall Creators Update.