|
| 1 | +--- |
| 2 | +title: Differences between in-process and isolate worker process .NET Azure Functions |
| 3 | +description: Compares features and functionality differences between running .NET Functions in-process or as an isolated worker process. |
| 4 | +ms.service: azure-functions |
| 5 | +ms.topic: conceptual |
| 6 | +ms.date: 09/29/2022 |
| 7 | +recommendations: false |
| 8 | +#Customer intent: As a developer, I need to understand the differences between running in-process and running in an isolated worker process so that I can choose the best process model for my functions. |
| 9 | +--- |
| 10 | + |
| 11 | +# Differences between in-process and isolate worker process .NET Azure Functions |
| 12 | + |
| 13 | +Functions supports two process models for .NET class library functions: |
| 14 | + |
| 15 | +[!INCLUDE [functions-dotnet-execution-model](../../includes/functions-dotnet-execution-model.md)] |
| 16 | + |
| 17 | +This article describes the current state of the functional and behavioral differences between the two models. |
| 18 | + |
| 19 | +## Execution mode comparison table |
| 20 | + |
| 21 | +Use the following table to compare feature and functional differences between the two models: |
| 22 | + |
| 23 | +| Feature/behavior | In-process<sup>3</sup> | Isolated worker process | |
| 24 | +| ---- | ---- | ---- | |
| 25 | +| .NET versions | Long Term Support (LTS) versions<br/>(.NET 6.0) | All supported versions + .NET Framework<br/>(.NET 6.0, .NET 7.0 (Preview), .NET Framework 4.8 (GA)) | |
| 26 | +| Core packages | [Microsoft.NET.Sdk.Functions](https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/) | [Microsoft.Azure.Functions.Worker](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker/)<br/>[Microsoft.Azure.Functions.Worker.Sdk](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk) | |
| 27 | +| Binding extension packages | [Microsoft.Azure.WebJobs.Extensions.*](https://www.nuget.org/packages?q=Microsoft.Azure.WebJobs.Extensions) | [Microsoft.Azure.Functions.Worker.Extensions.*](https://www.nuget.org/packages?q=Microsoft.Azure.Functions.Worker.Extensions) | |
| 28 | +| Durable Functions | [Supported](durable/durable-functions-overview.md) | [Supported (public preview)](https://github.com/microsoft/durabletask-dotnet#usage-with-azure-functions) | |
| 29 | +| Model types exposed by bindings | Simple types<br/>JSON serializable types<br/>Arrays/enumerations<br/>Service SDK types such as [BlobClient]<br/>`IAsyncCollector` (for output bindings) | Simple types<br/>JSON serializable types<br/>Arrays/enumerations | |
| 30 | +| HTTP trigger model types| [HttpRequest]/[ObjectResult] | [HttpRequestData]/[HttpResponseData] | |
| 31 | +| Output binding interaction | Return values (single output only)<br/>`out` parameters<br/>`IAsyncCollector` | Return values (expanded model with single or [multiple outputs](dotnet-isolated-process-guide.md#multiple-output-bindings)) | |
| 32 | +| Imperative bindings<sup>1</sup> | [Supported](functions-dotnet-class-library.md#binding-at-runtime) | Not supported | |
| 33 | +| Dependency injection | [Supported](functions-dotnet-dependency-injection.md) | [Supported](dotnet-isolated-process-guide.md#dependency-injection) | |
| 34 | +| Middleware | Not supported | [Supported](dotnet-isolated-process-guide.md#middleware) | |
| 35 | +| Logging | [ILogger] passed to the function<br/>[ILogger<T>] via dependency injection | [ILogger]/[ILogger<T>] obtained from [FunctionContext] or via [dependency injection](dotnet-isolated-process-guide.md#dependency-injection)| |
| 36 | +| Application Insights dependencies | [Supported](functions-monitoring.md#dependencies) | [Supported (public preview)](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ApplicationInsights) | |
| 37 | +| Cancellation tokens | [Supported](functions-dotnet-class-library.md#cancellation-tokens) | [Supported](dotnet-isolated-process-guide.md#cancellation-tokens) | |
| 38 | +| Cold start times<sup>2</sup> | (Baseline) | Additionally includes process launch | |
| 39 | +| ReadyToRun | [Supported](functions-dotnet-class-library.md#readytorun) | [Supported](dotnet-isolated-process-guide.md#readytorun) | |
| 40 | + |
| 41 | +<sup>1</sup> When you need to interact with a service using parameters determined at runtime, using the corresponding service SDKs directly is recommended over using imperative bindings. The SDKs are less verbose, cover more scenarios, and have advantages for error handling and debugging purposes. This recommendation applies to both models. |
| 42 | + |
| 43 | +<sup>2</sup> Cold start times may be additionally impacted on Windows when using some preview versions of .NET due to just-in-time loading of preview frameworks. This applies to both the in-process and out-of-process models but may be noticeable when comparing across different versions. This delay for preview versions isn't present on Linux plans. |
| 44 | + |
| 45 | +<sup>3</sup> C# Script functions also run in-process and use the same libraries as in-process class library functions. For more information, see the [Azure Functions C# script (.csx) developer reference](functions-reference-csharp.md). |
| 46 | + |
| 47 | +## Next steps |
| 48 | + |
| 49 | +To learn more, see: |
| 50 | + |
| 51 | ++ [Develop .NET class library functions](functions-dotnet-class-library.md) |
| 52 | ++ [Develop .NET isolated worker process functions](dotnet-isolated-process-guide.md) |
| 53 | + |
0 commit comments