No job functions found, migrating to .net 8 isolated worker process – Azure

by
Alexei Petrov
.net-8.0 azure-active-directory azure-functions

Quick Fix: Follow the steps and guidelines mentioned in the document for migrating your ASP.NET Core applications to the Azure Functions isolated worker process model, including updating your code and project files.

The Problem:

Migrating Azure Functions app to run in an isolated worker process in .Net 8, but no job functions are found during runtime. The console displays messages like ‘No job functions found. Try making your job classes and methods public.’ and ‘0 functions found’ while reading functions metadata.

The Solutions:

Solution 1: Configure the project correctly

To migrate an Azure Function app to run in an isolated worker process in .NET 8, you need to configure your project correctly. This includes:

  1. Installing .NET 8.0 and the latest Azure Function core tools

  2. Updating your project’s .csproj file to target .NET 8.0 and specify the Azure Functions Version as v4

  3. Adding the necessary NuGet packages, including Microsoft.Azure.Functions.Worker and Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore

  4. Adding the required configuration to your local.settings.json file, including setting the FUNCTIONS_WORKER_RUNTIME to dotnet-isolated

  5. Updating your Program.cs file to configure the Functions host to use the isolated worker process model.

using Microsoft.Azure.Functions.Worker;

var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults()
    .Build();

await host.RunAsync();
  1. Creating your function classes and methods in a public class

  2. Running the function app locally using the Azure Functions Core Tools

  3. Deploying the function app to Azure

Once you have completed these steps, your Azure Function app should be running in an isolated worker process in .NET 8.

\n

Solution 2: Update Azure Portal Configuration using Bicep Template

\n

To migrate your Azure Functions app to .NET 8 isolated worker process, you need to update the configuration in the Azure Portal using a Bicep template. Here’s how you can do it:

  1. Add the following properties to your Bicep template under the siteConfig object within the functionApp resource:
use32BitWorkerProcess: false
netFrameworkVersion: 'v8.0'
  1. Ensure that you are using the correct value for functionRuntime. For .NET 8 isolated worker process, the supported value is dotnet-isolated.

By making these changes, you are explicitly specifying that you want to use the .NET 8 isolated worker process and 64-bit platform for your Azure Functions app. This should resolve the issue of not finding any job functions when running your application in .NET 8.

Note:

  • Make sure to replace functionAppName, appInternalServiceName, keyVault, storageAccount, appInsightsInstrumentationKey, functionRuntime, and appTags with the actual values for your Azure Functions app.
  • You can find more information about Bicep templates for Azure Functions in the official documentation.

Q&A

What might cause function not to be listed when migrating to .NET 8?

Ensure you have .NET 8 and latest packages installed, and upgrade to latest Azure Function core tools.

How to apply BICEP settings for version 8 Isolated?

Set use32BitWorkerProcess: false and netFrameworkVersion: 'v8.0'.

Video Explanation:

The following video, titled "Using Durable Azure Functions in .NET 7 | .NET Conf 2022 - YouTube", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

With .NET 7 durable functions will be available for Azure Functions running in isolated mode. I've found that many people I've chatted to ...