Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Function Core Tools incorrectly default to .NET 6 when creating an in-process Function #4215

Open
gabrielweyer opened this issue Dec 21, 2024 · 1 comment · May be fixed by #4233
Open

Comments

@gabrielweyer
Copy link

Version

Using latest .NET 8 SDK (8.0.404) and Azure Function Core Tools (4.0.6610). I removed and installed Azure Function Core Tools again after installing the latest .NET 8 SDK.

> func version
4.0.6610
> dotnet --info
.NET SDK:
 Version:           8.0.404
 Commit:            7b190310f2
 Workload version:  8.0.400-manifests.996cfe54
 MSBuild version:   17.11.9+a69bbaaf5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.404\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
There are no installed workloads to display.

Host:
  Version:      8.0.11
  Architecture: x64
  Commit:       9cb3b725e3

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  6.0.428 [C:\Program Files\dotnet\sdk]
  7.0.410 [C:\Program Files\dotnet\sdk]
  8.0.111 [C:\Program Files\dotnet\sdk]
  8.0.404 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Description

Azure Function Core Tools incorrectly default to .NET 6 (unsupported since November 12, 2024) when creating an in-process Function. It should use .NET 8 (the current LTS) instead when --target-framework is not specified.

Steps to reproduce

# This incorrectly creates a .NET 6 in-process Function, it should default to .NET 8 (that's the current LTS)
func init MyProjFolder --worker-runtime dotnet

Forcing the Function App to use .NET 8:

# This creates a .NET 8 in-process Function
func init MyProjFolder --worker-runtime dotnet --target-framework net8.0
@mattchenderson
Copy link
Contributor

Thanks for flagging this. We have precedence from changing the default version in the isolated worker model. Updating the default for the in-process model would help with consistency and prevent folks from inadvertently landing on an unsupported version.

For whoever ends up picking this item up, this likely would be a change to the following line, with corresponding test updates:

private const string DefaultInProcTargetFramework = Common.TargetFramework.net6;

@saadalia saadalia linked a pull request Jan 17, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants