Michel
Michel

Reputation: 23645

Kudu not supported .net core 3.1: can not autodeploy my .Net core 3.1 function from bitbucket

I've used the bitbucket to deploy my function app to azure: when I check in on master in Bitbucket, my code gets deployed to Azure.

That worked great, but now I upgraded my function app from .net core 2.2 to 3.1 and...

Now I've got this exception:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling function App deployment with dotnet.exe.
D:\Program Files (x86)\dotnet\sdk\2.2.109\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [D:\home\site\repository\xxxxxx\xxxxxx\xxxxxx.csproj]
D:\Program Files (x86)\dotnet\sdk\2.2.109\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.1.  Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. [D:\home\site\repository\xxxxxx\UnitTest\UnitTest.csproj]
Failed exitCode=1, command=dotnet restore "D:\home\site\repository\xxxxxx\xxxxxx.sln"
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\85.11226.4297\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"    

So it says it doesn't support .net core 3.1

That is a clear error because I just updated it.

But I can't figure out what is giving me the error. I can't imagine it's Azure complaining, because they do support .net core 3.1 (https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions). I also can't imagine that the sources are built-in Bitbucket (are they?) and that Bitbucket doesn't support .net core 3.1?

EDIT I found some info on the one word 'Kudu'. Seems that it is on Azure, and responsible for deployments from (amongst others) GIT to Azure. So now I wonder why Kudu doesn't support .net core 3.1

Edit 2: My listed frameworks:

D:\home>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.15 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.15 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.2 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.16 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.14 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.2 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.1 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]

EDIT 3:

Can it be that this host.json is wrong?

{
    "version": "2.0"
}

Didn't read that it had to be changed, but maybe?

Upvotes: 0

Views: 651

Answers (1)

Alex
Alex

Reputation: 18556

Found the reason while writing another comment. From what I can see, you are pushing your sources to the AppService and let Kudu build the application. This does not work because while the 3.1 runtime is installed, the 3.1 SDK is not.

You will also see that if you run dotnet --list-sdks. You need to build your application before pushing it to Kudu, or wait until the 3.1 SDK is installed on the windows systems. You can also still try to use a Linux App Service.

https://github.com/Azure/app-service-announcements/issues/217

The SDK deployment will happen once the runtime is globally available.

After more than three months, runtime deployment is still not complete. So I expect the SDK deployment to take a bit more time.

Upvotes: 2

Related Questions