部署到 Linux 应用服务时 Angular CLI 应用未运行 [英] Angular CLI app not running when deploying to Linux App Service

查看:33
本文介绍了部署到 Linux 应用服务时 Angular CLI 应用未运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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:

  1. 使用 DevOps Build 构建 Angular CLI 应用,并将生成的dist"文件夹放到drop"文件夹中.请参见下面(图 2)构成我的构建的任务.这工作正常并创建了预期的文件.

  1. 在 DevOps 中创建了一个版本,将所有 dist 文件部署在 Linux 中 Azure 应用服务的 wwwroot 文件夹中.下面显示的是我运行 ng build --prod 后的 wwwroot 文件夹(左)和我的本地 dist 文件夹(右).

我怀疑我需要在进行部署时通过提供一些命令时间来启动 angular.我曾尝试运行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 应用服务之间有一个微妙而巨大的区别:IIS - 在 Windows 中它正在积极寻求为任何应用程序提供服务,而在 Linux 中你有自己制作一些东西来服务它 - 例如快递.

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 应用服务时 Angular CLI 应用未运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆