Reputation: 131
What I am trying to achieve is to deploy Angular 9 app to Azure App service with Linux OS (Windows does not suit me because Linux is cheaper) I created Linux web app with Node 14 runtime. After I deployed my app I see Azure default web page. I tried to resolve that as it is described here
Steps I did on Linux web app with Node 14 runtime:
I added this
pm2 serve /home/site/wwwroot --no-daemon --spa
to AppService->Configuration->General Settings->Startup Command
Saved configuration and restarted App Service But got pm2 not found error.
Connected to web app using ssh and have run
npm install pm2 -g
Restarted App Service but still getting pm2 not found.
The question is how to host Angular 9 on Linux app service with Node 14? Should I fix that pm2 not found or I can use some other approach (but still with Linux OS) to solve that?
Upvotes: 2
Views: 5334
Reputation: 22039
If you are not concerned about the release method, it is recommended that you execute ng build locally, and then drag and drop all the files in the <your project name>
folder directly to wwwroot, or use FTP to upload. Then modify startup cmd with npx serve -s
, it also can work.
Files in local.
Files in wwwroot on azure.
After testing, I think this should be a bug. If you must use node 14LTS, I suggest you raise a support ticket on portal for help.
Recurring problem:
Create a linux node 14LTS web app.
Create ng9 project, use vscode deploy and success. Open website and show us default page.
Add startup cmd with pm2 serve /home/site/wwwroot --no-daemon --spa
or pm2 serve /home/site/wwwroot/dist/<your project name> --no-daemon --spa
, and all failed.
Try to solve:
Major version
in Stack settings
, and the project runs normally.Upvotes: 8