How to run an Angular website in a Linux-based Azure app service

Darlene Fountaine 40 Reputation points

I'm trying to run the out-of-the box Angular website on a Linux-based Azure app service. Although the base Angular website could be run as a static website, I do not plan for the future, customized site to be static, so an Azure web service seems more appropriate as a proof-of-concept. I can successfully build the solution and upload it to an Azure repo. I can deploy the solution to Azure, but when I try to run it, Azure responds with "404 Not Found." I've set the startup command to

pm2 serve /home/site/wwwroot --no-daemon --spa or
pm2 serve /home/site/wwwroot/dist --no-daemon

with no luck. I've adjusted the index.html file to be

<base href="/"> or
<base href=".">

Nothing is working. Do you have any suggestions?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,001 questions
0 comments No comments
{count} votes

Accepted answer
  1. ajkuma 22,841 Reputation points Microsoft Employee

    @Darlene Fountaine , Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer. They can only accept answers by others, Summarized and posted the solution that you shared, request you to Accept the answer, it will benefit the community find the answers quickly.


    Setting up an Angular website on a Linux-based Azure app service.


    After successfully deploying an Angular website to an Azure app service, attempts to access the website result in a "404 Not Found" error.

    Things tried:
    The startup command has been configured using either ( did not work):

    pm2 serve /home/site/wwwroot --no-daemon --spa
    or pm2 serve /home/site/wwwroot/dist --no-daemon,

    and the <base href="/">
    or <base href="."> tag has been set in the HTML.

    Solution shared by @Darlene Fountaine


    This worked: pm2 serve /home/site/wwwroot/dist/<YourLocalAppName>/browser --no-daemon --spa

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Darlene Fountaine 40 Reputation points

    This command worked: pm2 serve /home/site/wwwroot/dist/<YourLocalAppName>/browser --no-daemon --spa.