Azure VSTS 使用 angular 和节点构建

Azure VSTS Builds with angular and Node

我正在用 Angular + AD B2C 和 Msal.js + Node + VsCode 做一个 WebApp,所以没有使用 web.config。 所以,我在这个步骤中在 Vsts 中做了一个 "build & Release" 定义:

到目前为止一切顺利,但是当我转到页面时无法获取清单,抛出此错误

  • Uncaught (in promise) Error: Manifest fetch failed! at Driver.fetchLatestManifest

  • /manifest.json 404 (Not Found)

  • Manifest: Line: 1, column: 1, Unexpected token.

我查找的内容是因为 .json 的 MIME 类型没有默认设置。这通常也适用于可能需要特定 MIME 类型的任何文件。

Link solution with Web.Config

但我没有 web.config 因为我不使用 net.core。

问题是,没有 web.config 我怎么能这样做?还是必须在 Azure Appserver 端配置?

需要web.config,但可以通过Azure App Service Deploy任务生成,还需要为Nodejs应用配置web.config参数。

  1. Select Azure 应用服务部署任务
  2. 选中文件转换和变量替换选项部分中的生成 Web.config 选项。
  3. 单击... > 选择节点作为应用程序框架并指定 NodeStartFile。

对于 MIME 问题,您可以通过 Kudu console (https://{app service name}.scm.azurewebsites.net/DebugConsole) 更新 web.config 文件,导航到 site\wwwroot,然后单击 web.config 的编辑图标文件以更新它并保存。