Deploying .Net Core to Linux WebApps on Azure with DevOps

南笙酒味 提交于 2019-12-23 17:05:09

问题


I have a build/release for a .Net Core WebApp that works on windows machines perfectly, however I want to be able to deploy the same codebase to Linux. I set up a build and release and am using the "Web App on Linux" to deploy to my Linux WebApp. I also made sure that the Runtime Stack(s) on BOTH the Build and on the WebApp are set to use .Net Core 2.2:

The builds and the release run perfectly, however once the deployment is complete the website goes to a 404 (replacing the default Azure startup HTML page). I've FTP'd into the WebApp and see that the files are deployed to the machine, however I see that there are multiple "wwwroot" folders:

The top "wwwroot" folder does contain the DLLs for my application so that is a good sign:

Curiously I can get to the static files from my app such as the CSS, JS or the favicon if I navigate to /wwwroot/(filename)

I am pretty sure I have everything set up properly so I am hitting a wall on things to try. I've never had issues like this deploying to Windows WebApps so I am sure there is a setting or something that I am unaware of or is missing from the documentation.

For further details on this issue here is my BUILD:

...and my RELEASE setup:


回答1:


I had a similar issue and the issue came down to how VS was publishing the zip vs Dev Ops. If you return to the Azure portal you will need to add a startup command specifying where your main DLL is located.

https://docs.microsoft.com/en-us/azure/app-service/containers/app-service-linux-faq#built-in-images



来源:https://stackoverflow.com/questions/54618574/deploying-net-core-to-linux-webapps-on-azure-with-devops

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