upgrade function app from asp.net 6 to asp.net 8.

ANKIT GHENGE 105 Reputation points
2025-01-28T13:15:10.1633333+00:00

hello team, i need to upgrade the azure function service from asp.net 6 to 8. i have updated the target framework to .net 8 and updated nugget packages as well. can you please help me to see if any additional changes required to upgrade the .net version so see if no issues with it.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,373 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 2,770 Reputation points Microsoft Vendor
    2025-01-28T14:24:17.05+00:00

    @ANKIT GHENGE ,

    Welcome to Microsoft Q&A Platform!

     To upgrade your Azure Function app from ASP.NET 6 to ASP.NET 8, make sure you do these updates:

    1. Update the Target Framework: Set your project file's TargetFramework to net8.0 which you already did.
    2. Update the SDK Version: If you're using a global.json file, bump the version property to the installed .NET 8.0 SDK version.
    3. Update Application Settings: For the in-process model, set these app settings in your Azure Function app:
      • FUNCTIONS_WORKER_RUNTIME to "dotnet".
      • FUNCTIONS_EXTENSION_VERSION to "~4".
      • FUNCTIONS_INPROC_NET8_ENABLED to "1".
    4. Check Package References: Update any Microsoft.AspNetCore., Microsoft.EntityFrameworkCore., and Microsoft.Extensions. package references to version 8.0 or later.
    5. Update Stack Configuration: Make sure the stack configuration in Azure points to .NET 8.
    6. Configuration Changes:
      • Verify the compatibility of any custom middleware or third-party libraries with .NET 8.
      • Update configuration files (e.g., appsettings.json) if there are new settings or changes required by .NET 8.

    After these changes, test your function app to ensure everything's working fine.

    References:

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.