部署到Linux App Service时Angular CLI应用未运行 [英] Angular CLI app not running when deploying to Linux App Service
问题描述
我正在尝试使用Azure Dev Ops将Angular CLI应用程序部署到Linux OS上的Azure应用程序服务-但没有成功.我得到图像1.服务器或应用程序日志中没有错误.
I'm trying to deploy an Angular CLI app to Azure App Service on Linux OS, using Azure Dev Ops - but no success. I get Image 1. No error in the server or application logs.
这是我到目前为止所做的:
This is what I done so far:
- 使用DevOps Build构建Angular CLI应用程序,并将生成的"dist"文件夹放置到"drop"文件夹中.参见下面的(图2)构成我的构建的任务.这可以正常工作并创建所需的文件.
- 在DevOps中创建了一个发行版,将所有dist文件部署在Linux中的Azure App Service的wwwroot文件夹中.运行ng build --prod之后,下面显示的是wwwroot文件夹(左)和我的本地dist文件夹(右).
我怀疑我在部署时需要通过花一些时间来启动角度.我试过运行"ng serve --host 0.0.0.0",但是没有用.
I have the suspicion that I need to kickstart the angular by feeding some time of command when doing the deployment. I have tried running "ng serve --host 0.0.0.0" but that didn't work.
推荐答案
Linux和Windows App服务之间有一个微妙而巨大的区别:IIS-在Windows中正在积极寻求服务任何应用程序,而在Linux中,您拥有自己动手做某事来服务(例如Express).
There is a subtle and big difference between the Linux and Windows App service: IIS - which in Windows is actively looking to serve any app, whereas in Linux you have to spin up something on your own to serve it - Express for example.
经过一番研究,我发现我不需要专门用于运行静态应用程序(例如Angular或React)的完整应用程序服务.借助Storage之类的工具,它既可以高效又便宜地完成.-> https://code.visualstudio.com/tutorials/static-website/入门
After some research I discovered that I don't need a full App service dedicated to run a static app (such as Angular or React). It can be done just as efficiently and much cheaper with something like Storage. -> https://code.visualstudio.com/tutorials/static-website/getting-started
这篇关于部署到Linux App Service时Angular CLI应用未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!