Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying an Angular Universal App in Azure web app service - Linux based

I'm trying to deploy an Angular Universal App in Azure web app service (Linux webapp) using azure devops pipeline and build/release pipeline are successfully completed. Please see below screenshot.

Build Pipeline

Release pipeline

Also, I tried to add this pm2 serve /home/site/wwwroot -no-daemon-spa in startup command for Azure Application Setting but no luck. I am still not able to accesss my angular webapp page. When I try to access Azure web app it's loading default azure webapp page.

Command sreenshot

when I check Azure Web App Application logs, I found this -

Platform logs contain errors or warnings

Container webapp_2_547df8bc didn't respond to HTTP pings on port: 8080, failing site start Container webapp_2_547df8bc for site webapp has exited, failing site start

Kindly suggest if some one has any idea?

like image 613
Ashwani Kumar Avatar asked Oct 30 '25 03:10

Ashwani Kumar


2 Answers

After spending couple of hours on this, I was able to deploy this app using Azure pipeline after making below change in server.ts file -

const distFolder = join(process.cwd(), 'dist/app_name/browser');

And changing startup command for Azure Application Setting from pm2 serve /home/site/wwwroot -no-daemon-spa to node /home/site/wwwroot/dist/app_name/server/main.js

like image 171
Ashwani Kumar Avatar answered Nov 01 '25 19:11

Ashwani Kumar


It worked for me without adding any changes in Angular, simply updated the below command in App services(Web app Linux) -> configuration -> Startup command

pm2 serve /home/site/wwwroot --spa --no-daemon
like image 28
Sathia Avatar answered Nov 01 '25 18:11

Sathia