I have a .NET 7 Blazor hybrid (Maui, Wasm, API, Shared, Data Access Layer) solution that I built from scratch. The existing solution has an API project that gets deployed to an Azure app service and a Wasm project that gets deployed to a static web app.
I want to upgrade my existing system to the new Maui Blazor Hybrid and web app project template mainly with the hope of hot reload actually working. In the default new set of projects I have migrated my old API project into the .web project that was created from the .NET 9 hybrid with web app template.
This seems logical to me as this project is intended to host the server side components. As soon as I got this working I started thinking about how this will be hosted in Azure and if I really should be creating a new separate project inside of my solution to host this API project.
If I leave my API code in the .web project won’t this mean that I will be deploying my entire app (web, server and API) to the same azure web app? I currently have all of my API endpoints in the .web project prepended with /api/
to get to the API endpoints.
What are other people doing with their Web APIs in Blazor Hybrid? I really like having the control of my API sitting in a separate app service from my frontend. This makes digging through application insights much easier and gives a clearer separation of concerns from a hosting standpoint.