简体   繁体   中英

Manually deploying angular app to Azure App Service

I am trying to manually deploy my angular app to azure by running "ng build --prod" and copying the resulting files from the "dist/app" folder onto the wwwroot folder of my Azure app service. For some reason, after dropping these files, the app service still shows the default app service page rather than my app. Here is a list of the files I have moved into the app service's wwwroot folder:

3rdpartylicenses.txt
favicon.ico
index.html
main-es2015.44f50893493deaba9227.js
main-es5.7eeefa6c83ea76b2321d.js
polyfills-es2015.e4a1185e6871d06f842f.js
polyfills-es5.68227219af2d6f215f11.js
runtime-es2015.10a1f01eef199006286d.js
runtime-es5.9ad22a88fcc70a015907.js
styles.2076d395e173f994808e.css
web.config

I have been trying for several days to get my app running, and building through kudu or deploying through VS Code Azure App Service extension have not worked so I thought this would be the simplest method of getting my app running. I apologize if this is a stupid question and I am missing something.

I was able to solve this by switching from using a Linux app service to a Windows app service. Everything else I did was the exact same. I am still very curious why what I was doing didn't work on Linux but I guess this is a solution.

Given this question is over a year old I assume that you either found an answer or gave up. I was stuck with this issue last night for a good few hours, but solved it quickly the next day (isn't that often the case!).

I deployed my Angluar app into a Linux Node 12 App Service. By default this serves opt/startup/hostingstart.html (the default page you're seeing), you need to point it to /home/site/wwwroot .

To do this go into your Azure App Service, go to Configuration tab -> General Settings and enter the following into the Startup Command: pm2 serve /home/site/wwwroot --no-daemon --spa

Done.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM