Static web site on Storage Account & App Service

Lopez Alonso, Luis 181 Reputation points
2021-03-22T10:05:12.757+00:00

Hi,
I've a conceptual question about Static web site on Storage Account & App Service.

My team have develop an Angular10 + ASP.NET Core (API) application. Our frontend (Angular10) only consumes our API , so the availability of our app depends on the availability of both, frontend + backend (our API will NOT be consumed by any other app). We don't have any latence issue or requirement as our final users are all in the same region. Our app must be consumed through HTTPS and with a specific name (CNAME).

When we deploy the app to Azure, my team decide to deploy it separately using a Store Account as static web site for Angular 10 and an AppService for the API as backend of our App.
As far I see on MS docs (here is the related article):

"App Service Static Web Apps is a great alternative to Azure Storage static website hosting and is also appropriate in cases where you don't require a web server to render content"

Because of we currently need an AppService to render content, i have some questions:

  • The app works but, is a correct arquitectural approach or is better only publish our app to an AppService?
  • There are any security/cost related/whatever topic that makes StaticWebSite + AppService approach better than only AppService deploy?

I think that this approach does not give us any facility or advantage. Instead of this, we have to configure more things on Azure to connect through SSL and to give a CNAME to our app and AppService deploy.

Please, can you give me your oppinion?

Thanks in advance
Best regards
Luis

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

Accepted answer
  1. Ryan Hill 28,631 Reputation points Microsoft Employee
    2021-03-23T17:47:59.11+00:00

    Hi anonymous user,

    Glad to see your interest in using Static Web Apps.

    The app works but, is a correct architectural approach or is better only publish our app to an AppService?

    IMHO, this is fine because your React app is doing your rendering client side.

    There are any security/cost related/whatever topic that makes StaticWebSite + AppService approach better than only AppService deploy?

    I can't provide any insights on costs due to the nature that Static Web Apps is still in Preview while the product team assess how best to meet the needs to users with this offering. Static Web Site is underpinned by Azure Functions, so to your point, the biggest advantage I would say is geographical distribution and scalability along with key features listed.

    Another option to consider is that fact you can host your API as an Azure Function and easily integrate with your static web app; see https://video2.skills-academy.com/en-us/azure/static-web-apps/apis.

    Configuring CNAME between App Service, Static Web Apps, and Azure Storage hosting are similar, so I wouldn't consider that a determining factor.

    Regards,
    Ryan


1 additional answer

Sort by: Most helpful
  1. sadomovalex 3,631 Reputation points
    2021-03-24T14:24:05.053+00:00

    if your web site doesn't have any server-side code there is no problem with hosting it as static web site. But ensure that there won't be CORS issues when front-end will call your backend API. If web site and backend API would be hosted in the same single App Service (e.g. in different sub folder but with the same common domain name) there won't be CORS problems because domain name will be the same.


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.