Search code examples
blazor-server-sideblazor-client-side

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?


Solution

  • 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.