Running Angular in Azure on a Linux Web App Running Angular in Azure on a Linux Web App azure azure

Running Angular in Azure on a Linux Web App


I was able to run Angular 9 on a Linux Web app by choosing PHP 7.3 as runtime stack. I simply build (in DevOps) and deployed the result of my ng build --prod (no neasted folders, just the files) and it worked as PHP can serve my index.html.

You dont have to put any startup command.

I followed this video to make the build, and this one to make the release.


That is not the way to go.

You should use the Angular CLI to compile your project and create your release artifacts (ng build --prod) inside a build pipeline (e. g. Azure DevOps) rather then use it to serve your application on a hosted site. Then within a release pipeline, you will publish the (compiled) artifacts to the Azure Web App.

If you want to do this locally, it is very similar. You compile your project and upload the result e. g. using Kudu.


I ended up abandoning this approach. The short answer is that I need something like Express to serve up the Angular app. However, Azure Blob Storage can be configured to serve up static web sites (e.g. Angular) and is dirt cheap. I'll need to set up Azure CDN to get a custom domain and SSL working, but this is so much easier and potentially much cheaper than the route I was going.