/ notes / azfunctions

Upgrading Azure Function from V3 to V4

Microsoft announced the 3 December 2022 as the deadline for migrating Azure functions from V3 to V4.

Migrating an existig function from V3 (.Net Core 3.1) to V4 (.Net Core 6) requires 3 macro steps:

1 - Upgrade the Visual Studio project from .net 3.1 to .net 6

OLD:
 <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
NEW:
 <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />



2 - Upgrade the running version of the function on Azure from V3 to V4

Using Cloud Shell CLI:

##show current app-settings
az functionapp config appsettings list --name functName --resource-group functResGroup --output table

##show current configuration
az functionapp config show  --name functName --resource-group functResGroup 

##migration to V4
az functionapp config appsettings set --settings FUNCTIONS_EXTENSION_VERSION=~4 --name functName --resource-group functResGroup

## set correct .net core version
az functionapp config set --net-framework-version v6.0 --name functName --resource-group functResGroup

## restart the function

Notes:

3 - Redeploy the function

Compile and deploy the function running on .Net 6

Notes

functions_v3_to_v4



References

Breaking changes between 3.x and 4.x

Migrate from ASP.NET Core 3.1 to 6.0

How to target Azure Functions runtime versions

Issues you may meet when upgrading Azure function app to V4

Azure Functions runtime versions overview

Azure Functions runtime versions overview / Migrating from 3.x to 4.x