如何使用 Kudu 将 Grunt 组装的网站发布到 Azure Web App 的根目录?

How to publish Grunt-assembled web site to the root of Azure Web App using Kudu?

我有一个由 Grunt 组装的网站(这个词正确吗?)。它具有以下结构:

/
  src/ (input)
    doc/
    images/
    js/
    scss/
    Web.config
  external/
  node_modules/
  dist/ (output)
    css/
    fonts/
    images/
    js/
  gruntfile.js
  package.json

为了使用持续部署和 Kudu 将其发布到 Azure Web 应用程序,我添加了 the following files:

.deployment
deploy.cmd

我可以像这样将网站上传到 /src 并将其部署到 /dist:

Directory of D:\home\site\wwwroot

06/30/2015  01:50 AM    <DIR>          .
06/30/2015  01:50 AM    <DIR>          ..
06/30/2015  02:21 AM                30 .deployment
06/30/2015  02:21 AM             3,679 deploy.cmd
06/30/2015  12:44 AM    <DIR>          dist
06/30/2015  12:40 AM    <DIR>          external
06/30/2015  02:21 AM             5,697 gruntfile.js
06/30/2015  12:43 AM    <DIR>          node_modules
06/30/2015  02:21 AM             1,173 package.json
06/30/2015  12:40 AM    <DIR>          src

但是当我将根目录指定为目的地时,我得到 an error:

Source and destination directories cannot be sub-directories of each other

这里正确的方法是什么?

编辑:根据讨论更改答案

尝试使用虚拟目录:https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/

默认情况下,所有站点 site\wwwroot 指向 / 虚拟目录。如果您希望 \dist 成为您的根目录,请更改虚拟目录条目,将 site\wwwroot\dist 作为物理路径,将 / 作为虚拟目录。

您可以配置 web.config 指定任何脚本作为您的启动脚本,配置如下:

  <system.webServer>
    <handlers>
      <add name="iisnode" path="/src/index.js" verb="*" modules="iisnode" />
    </handlers>
  </system.webServer>