.Net Core web api not working after deployed to Azure

烂漫一生 提交于 2019-12-05 20:55:33

So a web.config is needed. The one which VS 2017 populates with some default values when a new item is added it's not good. Using a VS 2017 web api default project, I've published it using right-click menu. That worked seamlessly. I've took the web.config from Azure web service and integrated it in my own project, changing only the dll name. Now, when a build job is running on behalf of TFS, it has the web.config among the files which are uploaded via FTP to Azure app service.

Here is the web.config I've ended with:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
  <remove name="aspNetCore"/>
  <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
  <aspNetCore processPath="dotnet" arguments=".\Somerandomname.WebApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>

I had a similar problem using Azure DevOps.

I decided to try publishing by right click deploy to a different app service, so that I could see what web.config I should have.

The right click deployed app did show /api/values where as the devops app did not.

The only difference in the web.configs were the location of stdoutLogFile

Using right click deploy

stdoutLogFile="\\?\%home%\LogFiles\stdout"  

Using devops

stdoutLogFile=".\logs\stdout

However right click deploy had included all my 3rd party dlls, so I am thinking somehow my devops pipeline nuget settings need correcting.

I am asking about that here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!