Upgraded this site (and associated function) to .NET 8

by Patrick Lee on 13 Oct 2024 in categories tech with tags ASP.NET Core Functions .NET 6.0 .NET 8.0

I have just upgraded this website from .NET 7 to .NET 8, and also the associated Azure function from .NET 6 in-process to .NET 8 isolated.

Upgrading an app service (website) from .NET 7 (or 6) to .NET 8 is pretty straightforward and essentially just involves changing the target framework in the csproj file to <TargetFramework>net8.0</TargetFramework>.

Upgrading an Azure function from .NET 6 (or 7) in-process to .NET isolated is quite a bit more complex, with several "gotchas" which Microsoft have not documented very well.  You have to not only make several more changes to the csproj file, and change "FUNCTIONS_WORKER_RUNTIME" from "dotnet to "dotnet-isolated", but you also have to change the way dependency injection works (thankfully to be more consistent with app services - the differences between app services and functions were very annoying in the past).  The way logging works also needs to change, and that is very poorly documented at the moment.