>> Hey, friends. I'm Scott Hanselman.
It's another episode of Azure Friday.
I'm here with Xiaokai He,
very excited about this SignalR service in Azure.
>> Correct.
>> And now, in preview.
>> Yes. You're right.
>> So, SignalR is part of ASP.NET, yes?
>> Yes. And it's also
supported by ASP call with the new version.
>> And people used SignalR for
WebSockets, for traversing networks.
I actually have a little startup that I had on the side,
and I put SignalR in the Cloud,
but I ended up having to
make my own SignalR as a service.
I needed the Azure website,
and I need a traffic manager.
I put a lot of work into it.
>> Yes. So, that's exactly the problem we are solving.
So, we saw a lot of people using
SignalR or they're in Azure, right?
And the program is seeking up their own server,
or managing the performance that gets out,
lots of those stuff.
So, that's why we come up with
the past service to help you with all those stuff.
That's why you don't need to worry about that anymore.
>> This is going to be great for people making
chat programs or games.
They're just not going to have to
worry about the website.
>> You're right. So, we are going to do
a demo for the chat program exactly,
so you can see how it goes.
>> That's perfect. Let's see that.
>> Yes. On the first step here,
I will show you how you can either a provision
a signal service with just server single step.
>> Okay.
>> So, you just type in SignalR here.
>> So, it shows up in
the marketplace just like anything else?
>> Yes. You can see that latency
because it's still in preview.
>> Sure.
>> So, if you click "Create",
so we will just ask you several,
very simple question, asking who is the subscription,
I'll choose one of my subscription.
And you need to select a location for your service,
as well as selecting the price here to
which level of the service you do need.
So, with the public preview,
actually, we have two different price here.
One, free price here,
which allows up to 100 connection
and a one minute message per month.
And this is the basic one,
which we charge for a little bit,
but it allows you to send
a hundred million messages per month.
>> That's a lot, and I'm already looking at the price,
and realizing this would be
half the price of me running in website.
>> Yes. You have the price estimate already, right?
>> Yes. This is good.
>> And you can also scale out which the unit you want.
So currently, with the private preview,
we are limited to one unit.
But then, when we go public view at huge,
we have 10 or I think almost 10 units you can use.
>> That's cool.
>> Yes. So, once you create,
it will take couple of minutes.
>> I think there's a question.
>> Yes. Research group name.
>> Research group already exists with that.
>> Let's just fix this.
So, it will take a couple of minutes
to really start a service,
but we can move on to the code.
>> Let's do it.
>> Yes. So, this is our basic chat demo.
Actually, we had the code samples on Github,
so you can take a look as well.
>> Okay.
>> So, there are only very simple,
couple of things you need to do.
So, you have basic SignalR client.
You probably will say, AddSignalR, right?
But here, by using the Azure SignalR,
you just change it to AddAzureSignalR.
>> Okay.
>> And in the next step, you use UseAzureSignalR,
like to replace your UseSignalR or mesa.
>> All right.
>> And with those, you only need to add
the one SignalR dependency
into your particular reference.
>> Okay.
>> And one additional step
you would need is to ask location.
So, for you to speak to your service,
you probably want some kind of authentication
to get a token and talk to a service.
So, here is a example of our AuthController.
So, in this controller,
we're not really using any authentication mechanism.
Basically, you just get a token free,
but you can actually use
your own authentication mechanism here
to making sure people get authenticated before.
So, intact to your service.
And then, in the front end,
basically, what you need to do is very simple.
You just getAccessToken and use that
token for your connection.
>> So, when on a client side
here now that you're in JavaScript,
I'm just using the regular SignalR JavaScript
that I know how to use already.
>> Yes, you're right. So with those,
which we already have the service,
let's take a look.
Yes. So, you can see here's the Azure SignalR service.
In the "Overview", there's little information.
But the key here is those key is which gives you
their connection stream you would be
using for interacting with your SignalR service.
So, if we copy those connections stream here,
I already put the connection stream to
my launch configuration for my application.
You can also use that, put it in your own environment
to wherever those keystart you want.
>> Okay.
>> So, basically, you just need a specified endpoint
as well as the access key.
With all those, we can just simply hit stop.
>> Okay. I like that you're using Visual Studio code
and this is nice just because
everybody can use SignalR as a service.
>> Yes.
>> And use it in Visual Studio code,
you also happened to be on a Mac.
>> Yes. You're right.
>> SignalR is cross platform
because it's part of the web.
>> Yes. Let's take a look.
So, the story is already running on Azure
and we want to connect to it, let's see.
So, this is me joining the chat.
>> Okay.
>> Yes. You can actually open up a Window.
>> There's two people on the chat now?
>> Yes. Let's see.
>> There I am.
>> So, you see Scott joined chat, and let's see.
>> So, it's hard on a Macintosh.
Yeah, you got to push that one. There you go.
Yeah, it's on another Window.
There you go. So, you can see, you're in and I'm in.
>> Yes. And if I have a message say, "Hi."
On the other parts,
we should also be able to see the message as well.
There you go. And you can just chat from there.
So, basically, it's already talking to
the secondary service we have
established on Azure from the local.
So, the next step,
you can actually deploy
your application to wherever you want
like Azure websites or making some change to it.
So, that's basically how easy it is to leverage.
So, just to operate our SignalR service
and leverage is always your own application.
>> So, in this case, the application
can be on Azure websites,
or containers, or whatever.
But the SignalR part is
handled by Azure SignalR as a service.
>> Yes. So, they are like
something you don't need to worry about.
>> Yes.
>> And you can actually also look at the log
we have here to figure
out what's happening with the service
like you have the Activity log.
You also have one for that,
so you can really manage
your service just like
you actually own the SignalR server.
>> So, then that means that because
SignalR is now in Azure, it's first class.
It's in ARM template. I can make one.
It's in the Diagnostics,
and Activity log, Access Control Tags.
All the things that I get with
a regular Azure service, I get with this.
>> And you also get a lot of
good integration with Azure service
where them integrated with Azure functions.
So, their function does event triggered.
Messages can be nature to fit to the SignalR service.
And we also have good integration with events grade.
So, they are all messaging services,
but they are targeting different scenarios
to make sure they work together.
>> And you said that there's a free tier,
there's a basic tier,
and then by build,
they'll be another like full tier, and I can scale up.
>> So, by build, the basic tier can
be scale out to 10 units,
and later you will have more premium tier for business,
and the like, and the price usage.
>> And you did this with ASP.NET Core,
but the client can be anything.
In this case, that the client was JavaScript.
>> Yes. Right now can be either done at
JavaScript for computer, at least has those two.
>> That's cool. So, this is in preview
now and where do I go to learn about how to set this up?
>> You can find this service in the Azure Portal.
We also have GitHub repo and ready
for those code samples and tutorials.
And we probably also publish something to
the customer who will come just in a minute.
>> That's pretty exciting.
>> Yeah, sure.
>> Cool. Thanks so much for sharing.
>> Thank you.
>> All right. I am learning all about
Azure SignalR as a service here on Azure Friday.