Skip to content

[In-Proc] Remove .NET 6 in-proc target #4802

@liliankasem

Description

@liliankasem

Background

The Azure Functions host will eventually stop servicing .NET 6 in-process. Once that happens, the in-proc branch of Core Tools should target .NET 8 only for in-proc support. This issue tracks the planning and work required to cleanly remove the net6.0 target framework from the in-proc build.

The codebase currently multi-targets net6.0 and net8.0, with net6-specific logic spread across ~18 files spanning the CLI project, build system, CI pipelines, static resources, and tests.

Scope

This change applies only to the in-proc branch. The main branch (OOP/isolated) is unaffected.

Work Items

1. Project files — remove net6.0 from TargetFrameworks

  • src/Azure.Functions.Cli/Azure.Functions.Cli.csproj
    • Change <TargetFrameworks>net6.0;net8.0</TargetFrameworks><TargetFrameworks>net8.0</TargetFrameworks>
    • Remove the net6.0-only PropertyGroup (lines 23-27) that gates IsPackable, PackAsTool, and ToolCommandName — move these to the default or the net8.0 condition.
    • Remove the net8.0-only <IsPackable>false</IsPackable> group (lines 28-30) since net8 becomes the only TFM and should now be packable.
    • Remove the net6.0 conditional ItemGroup for System.Text.Json (v6.0.11). Keep the net8.0 group or make it unconditional.
  • test/Azure.Functions.Cli.Tests/Azure.Functions.Cli.Tests.csproj
    • Change <TargetFrameworks>net6.0;net8.0</TargetFrameworks><TargetFrameworks>net8.0</TargetFrameworks>

2. C# code — remove net6 constants, helpers, and conditional logic

  • src/Azure.Functions.Cli/Common/TargetFramework.cs
    • Remove public const string net6 = "net6.0";
  • src/Azure.Functions.Cli/Helpers/TargetFrameworkHelper.cs
    • Remove TargetFramework.net6 from supportedTargetFrameworks and supportedInProcTargetFrameworks arrays.
  • src/Azure.Functions.Cli/Common/Utilities.cs
    • Remove #if NET6_0 preprocessor branch (line ~50).
  • src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs
    • Remove unused Net6FrameworkDescriptionPrefix constant.
  • src/Azure.Functions.Cli/Actions/LocalActions/InitAction.cs
    • Change DefaultInProcTargetFramework from net6 to net8.
    • Update ValidateTargetFramework fallback.
    • Update Dockerfile selection logic that falls through to net6 isolated Dockerfile.
  • src/Azure.Functions.Cli/Helpers/DotnetHelpers.cs
    • Remove/update comment about .NET 6.0 dotnet new short name behavior.
  • src/Azure.Functions.Cli/Actions/AzureActions/PublishFunctionAppAction.cs
    • Remove help text referencing .NET 6.

3. Build system — remove --inproc6 path

  • build/BuildSteps.cs
    • Remove Net6TargetFramework constant and Net6TargetFrameworkArgument (--inproc6).
    • Simplify Initialize() — default target framework is always net8.0.
    • Remove conditional NoWorkers flag that was net6-specific.
    • Remove/simplify language worker removal logic tied to the net6 build.
  • build/Settings.cs
    • Change default TargetFramework from "net6.0" to "net8.0" (line ~180, used for nupkg publish path).
  • build.ps1
    • Remove inproc6 artifact target framework option.
  • pipelineUtilities.psm1
    • Remove .NET 6.0 SDK entry from $DotnetSDKVersionRequirements.
  • validateWorkerVersions.ps1
    • Remove "net6.0" { "6" } case from the TFM → digit switch.
    • Default $TargetFramework parameter to "net8.0" (already the default — just verify).

4. CI/CD pipelines — remove inproc6 build jobs

  • eng/ci/public-build.yml
    • Remove the BuildInproc6 job and its artifactTargetFramework: inproc6 / tfm: net6.0 parameters.
  • eng/ci/official-build.yml
    • Remove the BuildInproc6 job, the func-cli-inproc6 artifact publication step, and related targetPath entries.
  • eng/ci/templates/public/jobs/build-test-public.yml
    • Remove .NET 6.0 SDK install steps.
  • eng/ci/templates/official/jobs/build-test.yml
    • Remove .NET 6.0 SDK install steps.

5. NuGet packaging

  • src/Azure.Functions.Cli/Azure.Functions.Cli.nuspec
    • Currently uses $targetFramework$ which resolves to net6.0 since only the net6 build was packable. After the change, this will resolve to net8.0. Verify the nuspec paths and NuGet tool pack still work correctly.
  • src/Azure.Functions.Cli/Azure.Functions.Cli.csproj
    • Ensure NuspecProperties passes the correct targetFramework value.

6. Static resources

  • src/Azure.Functions.Cli/StaticResources/stacks.json
    • Remove the .NET 6 In-process / dotnet6 stack entry (lines ~243-290).
    • Evaluate whether .NET 6 Isolated (dotnet6isolated, lines ~145-198) should also be removed — this depends on OOP servicing, not just in-proc. May be out of scope.
  • src/Azure.Functions.Cli/StaticResources/Dockerfile.dotnetIsolated
    • This is the net6 isolated Dockerfile (dotnet-isolated:4-dotnet-isolated6.0). Evaluate whether it should be removed or kept for OOP compatibility.
  • src/Azure.Functions.Cli/StaticResources/Dockerfile.dotnet
    • This is the net6 in-proc Dockerfile. Remove it.

7. Tests

  • test/Azure.Functions.Cli.Tests/E2E/InitTests.cs
    • Update assertion that expects "Valid options are net8.0, net6.0" — net6 will no longer be valid.
    • Remove [InlineData("dotnet-isolated", "4", "net6.0")] test case for Dockerfile init.
  • test/Azure.Functions.Cli.Tests/ZipHelperTests.cs
    • Remove/update comment referencing net6.

8. VS Code workspace config (optional / local-only)

  • .vscode/launch.json — Update debug program path from net6.0 to net8.0.
  • .vscode/tasks.json — Remove "net6.0" from the pickString publish target framework options.

Sequencing / Prerequisites

  1. Confirm host EOL date for .NET 6 in-proc — align this work with the host team's timeline.
  2. Land the per-TFM InProc package split first (see related issue) — this allows us to stop updating the net6 InProc version immediately, even before fully removing it.
  3. Coordinate with downstream consumers (VS, VS Code extension, VS for Mac) that may depend on the net6 build artifacts (func-cli-inproc6).
  4. Execute the removal per the work items above.
  5. Validate — full CI pass, func start with .NET 8 in-proc app, NuGet pack, publish across all RIDs.

Risk / Open Questions

  • NuGet tool packaging — The PackAsTool property was gated on net6.0. After moving it to net8.0, verify the global tool install (dotnet tool install -g Azure.Functions.CoreTools) still works.
  • Downstream artifact names — Pipelines publish artifacts like func-cli-inproc6. Consumers that reference this artifact name will break. Requires coordination.
  • Isolated .NET 6 support — Removing net6 in-proc doesn't necessarily mean removing net6 isolated stacks/Dockerfiles. Clarify scope with the team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions