angular - 在 Azure Web 应用程序服务中部署 Angular 通用应用程序 - 基于 Linux

标签 angular azure azure-devops pm2

我正在尝试使用 azure devops pipeline 和 build/在 Azure Web 应用服务 (Linux webapp) 中部署 Angular 通用应用发布管道已成功完成。请参阅下面的屏幕截图。

Build Pipeline

Release pipeline

此外,我尝试在启动命令中添加此pm2serve/home/site/wwwroot -no-daemon-spa Azure 应用程序设置 但没有运气。我仍然无法访问我的 Angular webapp 页面。当我尝试访问 Azure Web 应用程序时,它正在加载默认的 Azure Web 应用程序页面。

Command sreenshot

当我检查 Azure Web App 应用程序日志时,我发现了这个 -

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

如果有人有任何想法,请提出建议?

最佳答案

花了几个小时后,在 server.ts 文件中进行以下更改后,我能够使用 Azure 管道部署此应用程序 -

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

并将Azure应用程序设置启动命令pm2服务/home/site/wwwroot -no-daemon-spa更改为节点/home/site/wwwroot/dist/app_name/server/main.js

关于angular - 在 Azure Web 应用程序服务中部署 Angular 通用应用程序 - 基于 Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72097947/

相关文章:

angular - 如何使用 Edge 浏览器在 VSCode 中调试 Angular 应用程序? -跟进

Angular 6 - 引导轮播

azure - 如何在 MS Azure CosmosDB 中使用 SQL 查询嵌套列表和数组?

azure - 使用托管身份从 ADF 设置对 REST API 的调用时, "Resource"是什么

npm - 如何在 Visual Studio Team Services 构建代理中正确运行 NPM 安装

azure-devops - Azure 管道中部署作业中的条件批准门

angular - 如何在 Angular 6 的 mat-list-item 上使用 disabled 属性?

angular - 如何使用/创建动态模板来使用 Angular 2.0 编译动态组件?

azure - `az devops login` 和 `az login` 仍然请求个人访问 token

azure-devops - 在 Azure Devops 中复制发布管道所有阶段的更改