Deploying .Net Core to Linux WebApps on Azure with

2019-07-08 10:03发布

问题:

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