Slide 1

Slide 1 text

WEBINARS

Slide 2

Slide 2 text

is the biggest tech conference for developers in EMEA, open to all languages and technologies.

Slide 3

Slide 3 text

NEXT CONFERENCES CODEMOTION MADRID: September 24-25 CODEMOTION MILAN: October 24-25 CODEMOTION BERLIN: November 12-13 CODEMOTION AMSTERDAM 2020

Slide 4

Slide 4 text

VISIT OUR PLATFORM CODEMOTION.COM

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Andrea Ceroni [email protected] @andrekiba http://www.linkedin.com/in/andreaceroni elfo.net klabcommunity.org

Slide 7

Slide 7 text

Think in Real-time with Xamarin and Azure SignalR

Slide 8

Slide 8 text

Xamarin.Forms

Slide 9

Slide 9 text

Azure SignalR Service https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-overview

Slide 10

Slide 10 text

Pricing

Slide 11

Slide 11 text

Demo

Slide 12

Slide 12 text

Use SignalR Service Scale an ASP.NET Core SignalR App integrate with ASP.NET Core (based on this) allows to scale-out the number of connections Build serveless real-time apps using Azure Functions (v2) bindings it is possible to "react" to a whole series of events (storage, queue, http trigger...) Send messages from server to client with the REST API integrate with other apps that they can call the API and "push" informations to the clients tips...

Slide 13

Slide 13 text

Concepts Transports based on the server and client capabilities SignalR choose the best transport among WebSocket, Server-Sent Events e Long Polling Hubs an hub is a high level pipeline which allows clients and servers to call each other, passing "strongly-typed" parameters to the methods. The message contains the name of the method to be invoked and the related parameters. Therefore exists a real "contract" between client and server

Slide 14

Slide 14 text

With our without ASP.NET Core SignalR Azure SignalR Service Xamarin ASP.NET Core SignalR Server Hub Web App Console App Azure SignalR Service Server Endpoint Client Endpoint Xamarin Web App Console App What you want REST API

Slide 15

Slide 15 text

ASP.NET Core SignalR vs SignalR Service Persistent Connection Client App Server Azure SignalR Service Client App Server Persistent Connection Persistent Connection Negotiate

Slide 16

Slide 16 text

Different connections Server connections Persistent websocket connetcions are opened between SignalR Service and SignalR Server (5 by default), used for two-way communications with clients Client connections Clients are connected directly to SignalR Service, url and access token are resolved by the endpoint "negotiate" Data transmit 1 to 1 mapping between client connection and relative server connection that takes charge of it. Therefore SignalR Service acts as a transport layer between server and clients, completely managing the connections (scalability)

Slide 17

Slide 17 text

Meeting Rooms Microsoft Graph Meeting Room API Azure SignalR

Slide 18

Slide 18 text

SignalR Service Bindings for Azure Functions https://docs.microsoft.com/it-it/azure/azure-functions/functions-bindings-signalr-service#2x-c-input-examples

Slide 19

Slide 19 text

Server-less Architecture with Azure Functions Client Azure SignalR Service Persistent Connection Azure Functions negotiate Negotiate broadcast

Slide 20

Slide 20 text

Microsoft Graph API https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Demo

Slide 23

Slide 23 text

[FunctionName(" Question")] public async Task Question( [HttpTrigger(AuthorizationLevel.Anonymous, "post")] Question question, [SignalR(HubName = "Q&A")] IAsyncCollector answers) { var answer = iKnowTheAnswer J ? question.GetAnswer() : ... L ... return await answers.AddAsync(new SignalRMessage { Target = " Answer", Arguments = new [ ] { answer } }); }

Slide 24

Slide 24 text

Links https://github.com/andrekiba/Gab19 https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-overview https://github.com/Azure/azure-signalr/blob/dev/docs/rest-api.md https://docs.microsoft.com/it-it/azure/azure-functions/functions-bindings-signalr-service#2x-c-input-examples https://github.com/Azure/azure-signalr/blob/dev/docs/faq.md#service-mode https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0

Slide 25

Slide 25 text

Thanks! [email protected] [email protected] @andrekiba http://github.com/andrekiba http://www.linkedin.com/in/andreaceroni https://creativecommons.org/licenses/by-nc-sa/3.0/