Azure Functions lets you run event-driven, serverless code in the cloud.
When using .NET, you can choose between two hosting models:
In-Process Model – Functions run inside the Azure Functions runtime.
Isolated Worker Model – Functions run in a separate .NET process, communicating with the host via gRPC.
With the release of .NET 9 , the Isolated Worker Model is the recommended and future-proof option.
1. In-Process Model
In this model, your functions run within the Azure Functions host process.
Functions share memory and runtime with the host.
You get direct access to
ILogger, triggers, and bindings.Best for legacy apps or when you need maximum binding compatibility.
Example: In-Process Queue Trigger (C#, .NET 6)
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
public static class QueueExample
{
[FunctionName("QueueExample")]
public static void Run(
[QueueTrigger("my-queue", Connection = "AzureWebJobsStorage")] string message,
ILogger log)
{
log.LogInformation($"In-Process Function processed: {message}");
}
}
Notice that there’s no Program.cs. Everything is handled by the runtime host.
2. Isolated Worker Model (Recommended with .NET 9)
In this model, your functions run in a separate .NET process.
This gives you full control over:
Dependency Injection
Middleware
Hosting configuration
Supported runtime (you can target .NET 7, 8, or 9 without waiting for host updates).
Example: HTTP Trigger with .NET 9 Isolated Worker
Project file: FunctionApp.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.0.0-preview.6" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.0-preview.6" OutputItemType="Analyzer" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
</ItemGroup>
</Project>Program.cs
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
var host = Host.CreateDefaultBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
services.AddSingleton<IMyService, MyService>();
})
.ConfigureLogging(logging =>
{
logging.AddConsole();
})
.Build();
host.Run();
public interface IMyService
{
string GetMessage(string name);
}
public class MyService : IMyService
{
public string GetMessage(string name) => $"Hello {name}, from a .NET 9 Isolated Function!";
}
HelloFunction.cs

Join the conversation! Your thoughts help the community grow.