How to Fix HTTP Error 502.5 – Process Failure After Upgrading to .NET Core 2.0 in Azure

I recently upgraded a project from .NET Core 1.1 to .NET Core 2.0. After publishing to Azure I received the dreaded HTTP Error 502.5 – Process Failure error.

HTTP Error 502.5 - Process Failure

One thing I wasn’t aware of is that when publishing the new version of the app the old .NET Core 1.1 files were still in the wwwroot folder in the Azure App Service.

The easiest way to resolve this is to delete the wwwroot folder and recreate it using the Kudu Console.

You can get to the console by logging into Azure, selecting App Services, your service name, Advanced Tools, and finally click Go to open up the Kudu console.

Azure Kudu Console

You can also reach it directly by going to a URL:

Once you have the Kudu Console open click Debug console -> CMD (or PowerShell if that’s your thing).

Kudue Debug Console

Go to the site directory and delete the wwwroot folder.

Delete wwwroot Folder

Recreate an empty wwwroot folder.

Recreate an empty wwwroot folder

There was one last “gotcha” for me since we use Visual Studio Team Services Continuous Integration (CI) at work. I didn’t set up the release definitions, and I haven’t had to do a manual publish in a long time.

Make sure your publish files target framework is .NET Core 2.0, or you’ll have a bad time.

Visual Studio Publish Dialog