【问题标题】:Deployed Angular dist/ on Azure Web App showing me default screen在 Azure Web App 上部署 Angular dist/ 显示默认屏幕
【发布时间】:2023-03-31 14:53:01
【问题描述】:

我已经使用经典编辑器在 Azure DevOps 上设置了 CI-CD。我确实设法通过 Build Pipeline 和使用 Release 管道构建了 Angular 我已将 Angular /dist 文件夹推送到 Web 应用程序。

内容如下:

/home/site/wwwroot/my-angular-app/

但是,每当我打开 Web 应用程序的 url 时,我只能看到 azure Web 应用程序的默认网页。 我已经部署在 Web App (Linux) 上,我选择 Node 作为运行时任务。

由于我是 Azure 新手,还有什么需要做的吗?

提前致谢。

【问题讨论】:

  • 您可以添加对您的 YAML 文件的质疑吗?
  • 我使用经典编辑器构建管道@Krzysztof

标签: angular azure azure-devops azure-web-app-service


【解决方案1】:

在 Azure Web App 上部署 Angular dist/ 显示默认屏幕

在访问 https://{appservice_name}.azurewebsites.net 时,您需要做两件事才能使 Angular Web App 页面显示。

  1. 将 Angular /dist 文件夹部署到 azure web 应用程序时,请不要 包括 my-angular-app 文件夹。只要让 dist 的内容 /home/site/wwwroot 路径下的文件夹
  2. npx serve -s 添加为App Service > General settings 的启动命令:

希望这会有所帮助。

【讨论】:

  • 谢谢..但我收到类似“找不到请求的路径”之类的错误,我不认为它已发布到 App 引擎或我的代码。请您指导一下:)跨度>
  • @Ashu_FalcoN,你在哪一步得到了那个错误?你能在这里分享你的构建管道设置和整个构建日志吗?
  • 我在构建和发布管道中没有任何错误。打开应用引擎 url 时出现此错误。
  • @Ashu_FalcoN “npx serve –s”中的 – 不正确。请尝试“npx serve -s”。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-05-12
  • 2022-08-22
  • 1970-01-01
  • 2015-09-05
  • 2021-11-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多