Azure Functions: .NET 7 support is ending and you should upgrade to .NET 8.

On 14 May 2024, support for .NET 7 in Azure Functions will end. Your Function apps that are currently using .NET 7 will continue to run, but security updates will no longer be available. This means that there’s no best time to start upgrading your Azure Functions apps to use .NET 8 🙂

The upgrade of Azure Function apps to .NET 8 can be easy or not easy mainly depending on the Aure Functions model you’re currently using:

  • If you’re using the isolated worker model, upgrade to .NET 8 is easy (and I’ll talk about the steps here).
  • If you’re using the in-process model, your Azure Function apps at the moment can’t be updated to .NET 8 without switching to the isolated worker model.

Please remember that, as per the .NET Official Support Policy, .NET 7 reaches end of support on May 14, 2024, and .NET 6 reaches end of support on November 12, 2024. You should update any applications targeting those versions to .NET 8 before the end of support. If you’re using .NET 7 on Azure Functions, you’re already using the isolated worker model, and you should update your apps on the isolated worker model to .NET 8. The same instructions apply for .NET 6 on the isolated worker model.

The isolated worker model for Azure Functions is the future, so that’s another good reason to start using this model:

How to update your Azure Function app to .NET 8

The first required steps are to install the .NET 8 SDK locally and then update the references of your Azure Function project for using the latest stable versions of the following NuGet packages:

Then you need to update your project’s target framework to the new .NET 8 version, and for C# projects this can be done by opening the .csproj file and then update the <TargetFramework> parameter

When you have done that, you need to (eventually) make any updates to your project code that are required by the new .NET version (if you’re coming from .NET 6 or .NET 7, usually code changes are not needed) and then recompile your project.

Now you’re ready to update your Function app on Azure…

Open the Azure Portal, go to your Azure Function app and select the Configuration blade. Here you need to verify that your Function app is running on Runtime version 4.X:

Then (always under the Configuration blade) go into the General settings tab and here update .NET version to .NET 8 Isolated:

When you save the modification, your Azure Function app will be restarted and then it will work on the new .NET 8 runtime.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.