4
votes

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:

enter image description here

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:

enter image description here

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

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) enter image description here

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:

enter image description here

...and my RELEASE setup:

enter image description here

1
At least based on the Node.js tutorial, the folder structure is completely different, docs.microsoft.com/en-us/azure/app-service/containers/… and the .NET Core tutorial uses the Git deployment approach, docs.microsoft.com/en-us/azure/app-service/containers/…Lex Li
Try and add "-r ubuntu.16.10-x64" to your publish arguments and run the build again. It should create a self-contained asp.net core app for linux and your artifact should contain all you need to be able to run it.Marcus Höglund
Thanks Marcus. I just tried that but got the same results.INNVTV
Hi @INNVTV, I'm running into the same wall. Did you figure out what the problem was?Marius Bughiu
Hi @MariusBughiu No - I was spending too much time debugging that and opted to use a Windows server instead. I plan on coming back to this when I have some down time as I wanted to use Linux for cost savings and possibly to migrate to Kubernetes in the future. If I resolve this issue I will update this question. Please do the same if you resolve it first!!!!INNVTV

1 Answers

3
votes

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

enter image description here