Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React App not starting in azure app service

I've deployed a simple react app to azure app service and it won't start:

How do I get the app to run index.html?

enter image description here

like image 741
Batman Avatar asked Jun 17 '19 03:06

Batman


2 Answers

add this command in your azure dashboard > Configuration > Startup Command

pm2 serve /home/site/wwwroot --no-daemon

and restart your server. This fixed it for me!

like image 183
bach vo Avatar answered Nov 08 '22 18:11

bach vo


You don't need to install express and configure index.js as mentioned in other answers since that needs config change and not sure whether app scaling event will retain those installations in new instance.

Easy way is to use pm2 since that is already part of stack. Pass the below startup command for the app

pm2 serve /home/site/wwwroot --no-daemon

Once we restart, it should pick the pages from the docroot (/home/site/wwwroot)

like image 21
Satheesh Avatar answered Nov 08 '22 20:11

Satheesh