Can I used Redis as SignalR Backplane for Server Side Blazor application? - redis

I'm planning to buid a Server Side Blazor application.
It will be containerized with Docker and deployed to Amazon AWS, so in order to handle the scale-out for the service I don't have the option to use Azure SignalR service as Microsoft recommends in their documentation (see https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/server?view=aspnetcore-3.1#signalr-configuration).
We are curently using Redis as a backplane to manage our SignalR connections for another service, and I was wondering if it is possible to also use it in the same way for the Server Side Blazor application (see https://learn.microsoft.com/en-us/aspnet/core/signalr/redis-backplane?view=aspnetcore-3.1).
What do you think?
Thanks,
Xavi

Related

How to scale server-side Blazor application?

I know that it uses SignalR and requires a consistent connection over the network, and this mean there will be some kind of sticky session problem, which also mean we cannot just scale the deployment like in k8s in a braindead easy way.
I heard that SignalR can be configured to use a Redis backplane, but there doesn't seem to be an easy to do it with ASP.Net core, what steps do I need to do to scale server side Blazor, where the core part is about scaling SignalR? How do we integrate it with cloud native load balancers?
You can use Azure SignalR for scaling the connections in Azure. The docs might help you out on this.

Create SignalR server to use across multiple applications

I am building a micro-service-oriented .NET Core web application and now I want to add real-time communication. It is possible to create a SignalR server and publish it on Azure? I want to use it in my microservices to send messages to users when a certain even occurs.
Yes, you can deploy your app to Azure and point your users to your hub endpoint with no problems. You have two options here:
Use SignalR and manually manage the connections and other signalR stuff if you will scale your application. For example, when you have 2 web apps and the client connects to one of them, you need to "tell" to other app that you have a new client connected using for example Redis Blackplane.
Use Azure SignalR and this kind of management is not needed, what you need to provide is only 1 app with the hub logic. So when a client connects to your hub it is automaticaly redirected to the Azure SignalR.
You can read more about this two options here:
https://learn.microsoft.com/pt-pt/azure/azure-signalr/signalr-concept-scale-aspnet-core
Why not deploy SignalR myself?ยด
It is still a valid approach to deploy your own Azure web app supporting ASP.NET Core SignalR as a backend component to your overall web application.
One of the key reasons to use the Azure SignalR Service is simplicity. With Azure SignalR Service, you don't need to handle problems like performance, scalability, availability. These issues are handled for you with a 99.9% service-level agreement.
Also, WebSockets are typically the preferred technique to support real-time content updates. However, load balancing a large number of persistent WebSocket connections becomes a complicated problem to solve as you scale. Common solutions leverage: DNS load balancing, hardware load balancers, and software load balancing. Azure SignalR Service handles this problem for you.
Another reason may be you have no requirements to actually host a web application at all. The logic of your web application may leverage Serverless computing. For example, maybe your code is only hosted and executed on demand with Azure Functions triggers. This scenario can be tricky because your code only runs on-demand and doesn't maintain long connections with clients. Azure SignalR Service can handle this situation since the service already manages connections for you. See the overview on how to use SignalR Service with Azure Functions for more details.
Yes you can, this is the official quick start sample.
https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-quickstart-dotnet-core

Is it possible: Using Blazor serverside as a client app

There is a ready azure microservices that I need to build a client app against. There are 2 choices blazor server side and client side. Because the client side is not ready yet and has limited debugging capabilities I want to use blazor server side.
My question is if calling services from blazor server side is possible and if it is a good idea. To use it as a client app?
And also if it is possible to host blazor next to the microservices in azure?
I believe what you are asking is if it's acceptable to use the Blazor server side as a proxy to a microservice?
Technically, there's no reason that you couldn't. You would simply create an HttpClient to call your Microservice assuming that it exposes a REST API.
I'm not sure what you mean by, "..if it is possible to host blazor next to microservices in azure?" If you're using an Azure Web App to host your microservice, you would probably want to create a new Web App for your blazor server side app, otherwise you aren't really getting the benefit from the app service.
There are other options for configuring this type of architecture, but it all depends on your goals. Additionally, you might want to check out the following project:
https://github.com/Suchiman/BlazorDualMode
It will let you run blazor client and server side together. I've used it to help debug client side blazor apps.

Using Windows Authentication with Azure Service Fabric with ASP.NET Core

I want to use an ASP.NET Core Web API Service that should run in Azure Service Fabric. Is it possible to use Windows Authentication to secure the web Service?
I want to prevent that the user who uses this needs to log into the System manually.
Only when using WebListener. Kestrel doesn't support it, because it is a cross platform implementation.
Here's an example.

Can the SQL Server Service Broker converse with a service in a web server (IIS) application?

Is there any way to communicate to application components within the Web Server. My application is made up of a Web Application on IIS 7.0 and a database on SQL Server 2005. I have several satellite services that are poling the database, and I am wanting to replaces these with web services that are triggered from the SQL database itself.
Can the Service Broker do this? Can it send start a conversation with a service within the web server (i.e. an ASP.Net page, a web service, or even a WCF service)?
Edits:
Is there any way that SQL server can call a web application component (i.e. web service, ASP.Net page. etc...). I need to know.
Yes, in the form of "Query Notifications" which builds on Service Broker
I haven't done it myself but this page on MSDN shows you a few options and further link
"Query Notifications in SQL Server (ADO.NET)"
As I understand it, there is no direct Service Broker API and it's done via SQL commands.
Hence the use of SQLDependency or SQLNotificationRequest in .net not Service Broker directly. This article explains more http://javiercrespoalvez.com/2009/03/using-sql-service-broker-in-net.html