So the time has come to upgrade your old Azure Functions app to the latest version.
Now that we have the .NET Upgrade Assistant, the process is “fairly” pain-free.
However, if you run through the upgrade process, and fix any Nuget issues and binding issues (like no more QueueInput binding!) then you may encounter the following error.
No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
The culprit to this is what I think is a fairly basic oversight of the upgrade assistant.
Since .NET 5, the isolated process model of Azure Functions has been the recommended model replacing the in-process model.
The primary way the Azure Functions worker knows which model to use is the FUNCTIONS_WORKER_RUNTIME
setting.
For the original in-process model, this was dotnet
but for the isolated model, this needs to be dotnet-isolated
So change this in the local.settings.json file
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
to this
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
}
}
And you should see your functions showing up again