Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying ASP.net Core 2.0 to Azure

I have upgraded an ASP.net Core 1.1 app to ASP.net Core 2.0 with the following steps:

  • Changed the Target Framework to 2.0
  • Upgraded all Nugget Packages

Now my auto deployment from git runs and says it is successful but the app does not run. I get the following error:

HTTP Error 502.5 - Process Failure

I also added a separate web app deployment slot and tried deploying it there and still get the same result. I have also tried deploying it manually to the slow and no change.

like image 428
Jonathan Avatar asked Aug 15 '17 17:08

Jonathan


People also ask

Do Azure functions support .NET Core?

On 3 December 2022, extended support for Microsoft . NET Core 3.1 will end. After that date, your applications that are hosted on Functions will continue to run and your applications will not be impacted. However, we'll no longer provide patches or customer service for .

How do I publish from Visual Studio to Azure 2022?

Create or open an Azure cloud service project in Visual Studio. In Solution Explorer, right-click the project, and, from the context menu, select Convert > Convert to Azure Cloud Service Project. In Solution Explorer, right-click the newly created Azure project, and, from the context menu, select Publish.


2 Answers

The accepted answer did not fix the problem for me.

Steps Required:

Launch Azure Console within the app and delete the contents of the wwwroot folder then redeploy.

RMDIR wwwroot /S /Q

Also, if you have installed the Application Insights Extension within your app. When the app starts you will receive an exception stating that it can't be found.

To fix this error reinstall the Application Insights Extension from the Extensions blade and restart the app.

The problem with the wwwroot folder is that the old Core 1.1 files are not overwritten. Removing the contents of the directory resolves the problem.

like image 158
code Avatar answered Sep 20 '22 19:09

code


I had the same problem, which was caused by files leftover from a previous .NET Core 1.1 deployment. The easiest way to fix this is to check the "Remove additional files at destination" under the File Publish Options in your Publish Settings when publishing to Azure from VS.

File Publish Options

like image 37
Stefan Avatar answered Sep 21 '22 19:09

Stefan