Azure网站404 index.html

时间:2016-10-23 10:11:04

标签: azure continuous-integration azure-web-sites .net-core

我试图在Azure网站上运行我的应用程序, 但是我在让index.html工作时遇到了问题。

该应用程序存在于2个项目中:

  • Api(.net core)
  • 客户(角度)

在我的构建定义中,我将结果从我的客户端和Api复制到$(Build.ArtifactStagingDirectory) 然后我发布了

到目前为止,我可以在我的网站的wwwroot中找到我客户端的文件(通过kudu控制台)

但是当我导航到index.html时,我得到了 404 。但是,转到/api/...链接只是按预期工作

所以我认为问题是我的web.config覆盖导航到index.html文件的可能性。

的web.config

<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\Portal4Fun.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>

1 个答案:

答案 0 :(得分:1)

在.net Core中,您需要确保使用静态文件中间件,请参阅static files documentation以了解如何添加它 - 默认情况下应该在新的.net核心项目中使用。没有这个中间件,就不会提供静态文件 - 例如。 * .css,*。js,* .html等!

相关问题