When building a web application with a frontend and an API, should I use App Service only or Static Web App and App Service ?

Alexandre 351 Reputation points MVP
2022-01-02T09:24:46.607+00:00

I am building a web application with a frontend (written in Vue.js) and a backend (an ASP.NET Core API).
I don't know if I should host both the frontend and the backend on an App Service or if I should use a Static Web App for my frontend and an App Service for my backend.

I am aware of the differences between them, I have read the existing Q&A on the topic (https://learn.microsoft.com/en-us/answers/questions/398042/app-service-vs-static-web-app.html) but I don't know what is the recommended way of hosting an API and a front, separately or not.

Thanks for your answers.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cristian SPIRIDON 4,486 Reputation points Volunteer Moderator
    2022-01-02T14:26:39.99+00:00

    Hi,

    The recommanded way to host an web app is to separate static from dynamic content. In Azure you can do that with App Gateway:

    https://learn.microsoft.com/en-us/azure/application-gateway/how-application-gateway-works

    You can create rules that will route the static content to Static Web App and dynamic content to App Service.

    Hope this helps!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.