Introduction
Azure Functions is a serverless compute service that enables you to run event-driven code without managing infrastructure. Over time, Microsoft has introduced different hosting models for Azure Functions, including the in-process model and the isolated process model. The in-process model runs your function code in the same process as the Azure Functions host, while the isolated process model runs your function code in a separate process, providing greater flexibility and compatibility with different .NET versions. Migrating Azure Functions from the in-process model to the isolated worker model is a crucial step to ensure compatibility with future .NET versions and to leverage enhanced flexibility and control over your application's lifecycle. Microsoft has announced that support for the in-process model will end on November 10, 2026, making it imperative for developers to transition to the isolated worker model.
In this article, we’ll explore the reasons for migrating from the in-process model to the isolated process model, the key differences between the two, and a step-by-step guide to performing the migration with a detailed example.
Prerequisites
- An existing Azure Function app using the in-process model.
- .NET 6 or later installed on your development machine.
- Azure Functions Core Tools installed.
Understanding the In-Process vs. Isolated Worker Model
In-Process Model
- Runs inside the Azure Functions runtime.
- It shares the same process, and AppDomain is the runtime.
- Limited to specific .NET versions supported by the Azure Functions runtime.
- Can lead to dependency conflicts.
Isolated Worker Model
- Runs in a separate process, independent of the Azure Functions runtime.
- Allows targeting any .NET version without being tied to the runtime.
- Provides better dependency management.
- Offers full control over startup configuration and middleware.
Why Migrate to the Isolated Process Model?
- .NET Version Flexibility: The in-process model is tightly coupled with the Azure Functions runtime, which limits the supported .NET versions. The isolated process model allows you to use newer versions of .NET (e.g., .NET 6, .NET 7, or later) independently of the Azure Functions runtime.
- Dependency Isolation: Running in an isolated process ensures that your function app’s dependencies do not conflict with the Azure Functions runtime.
- Improved Performance and Stability: Isolated process model provides better performance and stability by decoupling your function code from the runtime.
- Future-Proofing: Microsoft is investing more in the isolated process model, making it the recommended approach for new function apps.
Key Differences Between In-Process and Isolated Process Models
| Feature | In-Process Model | Isolated Process Model |
|---|---|---|
| Hosting | Runs in the same process as the runtime | Runs in a separate process |
| .NET Version Support | Limited to specific .NET versions | Supports newer .NET versions (e.g., .NET 6+) |
| Dependency Management | Shared with the runtime | Isolated from the runtime |
| Startup Configuration | Uses Startup.cs for dependency injection | Uses Program.cs for dependency injection |
| Function Execution | Directly integrated with the runtime | Communicates with the runtime via gRPC |
Step-by-Step Migration Guide
Let’s walk through the process of migrating an Azure Function from the in-process model to the isolated process model.
Step 1. Update the Project File.
The first step in migrating is updating the .csproj file to align with the isolated worker model requirements. Modify the .csproj file.
- Set Target Framework: Ensure <TargetFramework> is set to net8.0.
- Set Azure Functions Version: Set <AzureFunctionsVersion> to v4.
- Add Output Type: Include <OutputType>Exe</OutputType>.
- Replace Package References: Remove Microsoft.NET.Sdk.Functions.
- Your isolated worker model application should not reference any packages in the Microsoft.Azure.WebJobs.* namespaces or Microsoft.Azure.Functions.Extensions. If you have any remaining references to these, they should be removed and add the following references.
<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" /> <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" /> <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.2.1" /> <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" /> <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" /> </ItemGroup> - Add Required Using Statement.
<ItemGroup> <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext"/> </ItemGroup> - Preserve Configuration Files: Ensure host.json and local.settings.json are copied correctly


Join the conversation! Your thoughts help the community grow.