Deploying ASP.net Core 2.0 to Azure

Viewed 4708

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.

4 Answers

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

This problem also happens when using DevOps Pipeline for the code targeted to dotnet core 2.1. This is because as of today 10/2, Azure is using DotNetCore 3.0 as default runtime (at least that's what it looks to be). To resolve this problem in devops pipeline, you must install the SDK

Yaml Code:

 steps:
 - task: UseDotNet@2
  displayName: 'Install Core 2.1'
inputs:
  version: 2.2.104

PS: This tells me that you've to install SDK on destination machine too, for dotnet to compile in correct version. (Azure or Windows Server whichever is your destination)

Related