Host static apps from multiple Azure blob storage accounts through one domain

299 views Asked by At

I have got multiple projects, each has its own storage account (Needed for billing, data residency and various other admin and security reasons). Each project/account has multiple static websites.

I have created an app service which is a wrapper site, i.e wrapper-site.com that serves the static apps in an iframe. Static apps are from one or more storage accounts.

Is there any way to not use iframes and serve the static apps directly through my app service?

The static apps have many libraries it uses and we need to keep the folder structure same so the static app's index.html can pull the libraries in.

I was thinking of somehow pulling in the entire static app, along with libraries, in my app service when someone visits wrapper-site.com, but I have a gut feeling that isn't the way.

enter image description here

Found this similar question but in my case, I need multiple places to host the static apps, based on project, and have a universal wrapper app that can pull in the static apps.

1

There are 1 answers

0
Ryan Hill On

There isn't a well known workflow that I know of. Since you mentioned that your app service is a nodejs app, loading static content like (see https://www.dotnetcurry.com/nodejs/1144/nodejs-html-static-pages-website):

fs.readFile("/site1/index.html", function(err, data){
  response.writeHead(200, {'Content-Type': 'text/html'});
  response.write(data);
  response.end();
});

where /site1/index.html could be loaded via app service storage mount.

I'm not sure if that's a viable workflow for you. Especially since app service storage mount is limited to five storage accounts.

I don't believe Application Gateway would be suitable as I couldn't find any docs where an AppGw was created without a VNET. Azure Storage accounts as far as I know, doesn't support VNET integration.