Skip to content

Commit ef0ca49

Browse files
Adding in-process model option for net8
1 parent e4fb90e commit ef0ca49

11 files changed

+236
-87
lines changed

articles/azure-functions/dotnet-isolated-in-process-differences.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Use the following table to compare feature and functional differences between th
2727

2828
| Feature/behavior | Isolated worker model | In-process model<sup>3</sup> |
2929
| ---- | ---- | ---- |
30-
| [Supported .NET versions](#supported-versions) | Long Term Support (LTS) versions,<br/>Standard Term Support (STS) versions,<br/>.NET Framework | Long Term Support (LTS) versions<sup>6</sup> |
30+
| [Supported .NET versions](#supported-versions) | Long Term Support (LTS) versions,<br/>Standard Term Support (STS) versions,<br/>.NET Framework | Long Term Support (LTS) versions, ending with .NET 8 |
3131
| Core packages | [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) | [Microsoft.NET.Sdk.Functions](https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/) |
3232
| Binding extension packages | [Microsoft.Azure.Functions.Worker.Extensions.*](https://www.nuget.org/packages?q=Microsoft.Azure.Functions.Worker.Extensions) | [Microsoft.Azure.WebJobs.Extensions.*](https://www.nuget.org/packages?q=Microsoft.Azure.WebJobs.Extensions) |
3333
| Durable Functions | [Supported](durable/durable-functions-dotnet-isolated-overview.md)| [Supported](durable/durable-functions-overview.md) |
@@ -42,6 +42,7 @@ Use the following table to compare feature and functional differences between th
4242
| Cancellation tokens | [Supported](dotnet-isolated-process-guide.md#cancellation-tokens) | [Supported](functions-dotnet-class-library.md#cancellation-tokens) |
4343
| Cold start times<sup>2</sup> | [Configurable optimizations](./dotnet-isolated-process-guide.md#performance-optimizations) | Optimized |
4444
| ReadyToRun | [Supported](dotnet-isolated-process-guide.md#readytorun) | [Supported](functions-dotnet-class-library.md#readytorun) |
45+
| [Flex Consumption] | [Supported](./flex-consumption-plan.md#supported-language-stack-versions) | Not supported |
4546

4647
<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.
4748

@@ -53,8 +54,6 @@ Use the following table to compare feature and functional differences between th
5354

5455
<sup>5</sup> ASP.NET Core types are not supported for .NET Framework.
5556

56-
<sup>6</sup> .NET 8 is not yet supported on the in-process model, though it is available on the isolated worker model. For information about .NET 8 plans, including future options for the in-process model, see the [Azure Functions Roadmap Update post](https://aka.ms/azure-functions-dotnet-roadmap).
57-
5857
[HttpRequest]: /dotnet/api/microsoft.aspnetcore.http.httprequest
5958
[IActionResult]: /dotnet/api/microsoft.aspnetcore.mvc.iactionresult
6059
[HttpRequestData]: /dotnet/api/microsoft.azure.functions.worker.http.httprequestdata?view=azure-dotnet&preserve-view=true

articles/azure-functions/functions-app-settings.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,16 @@ The following major runtime version values are supported:
394394
| `~2` | 2.x | No longer supported |
395395
| `~1` | 1.x | Support ends September 14, 2026 |
396396

397+
## FUNCTIONS\_INPROC\_NET8\_ENABLED
398+
399+
Indicates whether to an app can use .NET 8 on the in-process model. To use .NET 8 on the in-process model, this value must be set to `1`. See [Updating to target .NET 8](./functions-dotnet-class-library.md#updating-to-target-net-8) for complete instructions, including other required configuration values.
400+
401+
|Key|Sample value|
402+
|---|------------|
403+
|FUNCTIONS_INPROC_NET8_ENABLED|`1`|
404+
405+
Set to `0` to disable support for .NET 8 on the in-process model.
406+
397407
## FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR
398408

399409
This app setting is a temporary way for Node.js apps to enable a breaking change that makes entry point errors easier to troubleshoot on Node.js v18 or lower. It's highly recommended to use `true`, especially for programming model v4 apps, which always use entry point files. The behavior without the breaking change (`false`) ignores entry point errors and doesn't log them in Application Insights.
@@ -409,11 +419,6 @@ For Node.js v18 or lower, the app setting can be used and the default behavior d
409419
|FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR|`true`|Block on entry point errors and log them in Application Insights.|
410420
|FUNCTIONS\_NODE\_BLOCK\_ON\_ENTRY\_POINT\_ERROR|`false`|Ignore entry point errors and don't log them in Application Insights.|
411421

412-
## FUNCTIONS\_V2\_COMPATIBILITY\_MODE
413-
414-
>[!IMPORTANT]
415-
> This setting is no longer supported. It was originally provided to enable a short-term workaround for apps that targeted the v2.x runtime to be able to instead run on the v3.x runtime while it was still supported. Except for legacy apps that run on version 1.x, all function apps must run on version 4.x of the Functions runtime: `FUNCTIONS_EXTENSION_VERSION=~4`. For more information, see [Azure Functions runtime versions overview](functions-versions.md).
416-
417422
## FUNCTIONS\_REQUEST\_BODY\_SIZE\_LIMIT
418423

419424
Overrides the default limit on the body size of requests sent to HTTP endpoints. The value is given in bytes, with a default maximum request size of 104857600 bytes.
@@ -422,6 +427,11 @@ Overrides the default limit on the body size of requests sent to HTTP endpoints.
422427
|---|------------|
423428
|FUNCTIONS\_REQUEST\_BODY\_SIZE\_LIMIT |`250000000`|
424429

430+
## FUNCTIONS\_V2\_COMPATIBILITY\_MODE
431+
432+
>[!IMPORTANT]
433+
> This setting is no longer supported. It was originally provided to enable a short-term workaround for apps that targeted the v2.x runtime to be able to instead run on the v3.x runtime while it was still supported. Except for legacy apps that run on version 1.x, all function apps must run on version 4.x of the Functions runtime: `FUNCTIONS_EXTENSION_VERSION=~4`. For more information, see [Azure Functions runtime versions overview](functions-versions.md).
434+
425435
## FUNCTIONS\_WORKER\_PROCESS\_COUNT
426436

427437
Specifies the maximum number of language worker processes, with a default value of `1`. The maximum value allowed is `10`. Function invocations are evenly distributed among language worker processes. Language worker processes are spawned every 10 seconds until the count set by `FUNCTIONS_WORKER_PROCESS_COUNT` is reached. Using multiple language worker processes isn't the same as [scaling](functions-scale.md). Consider using this setting when your workload has a mix of CPU-bound and I/O-bound invocations. This setting applies to all language runtimes, except for .NET running in process (`FUNCTIONS_WORKER_RUNTIME=dotnet`).

articles/azure-functions/functions-dotnet-class-library.md

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,62 @@ Azure Functions supports C# and C# script programming languages. If you're looki
2929

3030
[!INCLUDE [functions-dotnet-supported-versions](../../includes/functions-dotnet-supported-versions.md)]
3131

32+
### Updating to target .NET 8
33+
34+
> [!NOTE]
35+
> Targeting .NET 8 with the in-process model is not yet enabled for Linux, for apps hosted in App Service Environments, or for apps in sovereign clouds. Updates will be communicated on [this tracking thread on GitHub](https://github.com/Azure/azure-functions-host/issues/9951).
36+
37+
Apps using the in-process model can target .NET 8 by following the steps outlined in this section. However, if you choose to exercise this option, you should still begin planning your [migration to the isolated worker model](./migrate-dotnet-to-isolated-model.md) in advance of [support ending for the in-process model on November 10, 2026](https://aka.ms/azure-functions-retirements/in-process-model).
38+
39+
Many apps can change the configuration of the function app in Azure without updates to code or redeployment. To run .NET 8 with the in-process model, three configurations are required:
40+
41+
- The [application setting](./functions-how-to-use-azure-function-app-settings.md) `FUNCTIONS_WORKER_RUNTIME` must be set with the value "dotnet".
42+
- The application setting `FUNCTIONS_EXTENSION_VERSION` must be set with the value "~4".
43+
- The application setting `FUNCTIONS_INPROC_NET8_ENABLED` must be set with the value "1".
44+
- You must [update the stack configuration](./update-language-versions.md#update-the-stack-configuration) to reference .NET 8.
45+
46+
Support for .NET 8 still uses version 4.x of the Functions runtime, and no change to the configured runtime version is required.
47+
48+
To update your local project, first make sure you are using the latest versions of local tools. Then ensure that the project references [version 4.4.0 or later of Microsoft.NET.Sdk.Functions](https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/4.4.0). You can then change your `TargetFramework` to "net8.0". You must also update `local.settings.json` to include both `FUNCTIONS_WORKER_RUNTIME` set to "dotnet" and `FUNCTIONS_INPROC_NET8_ENABLED` set to "1".
49+
50+
The following is an example of a minimal `local.settings.json` file with these changes:
51+
52+
```xml
53+
<Project Sdk="Microsoft.NET.Sdk">
54+
<PropertyGroup>
55+
<TargetFramework>net8.0</TargetFramework>
56+
<AzureFunctionsVersion>V4</AzureFunctionsVersion>
57+
</PropertyGroup>
58+
<ItemGroup>
59+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.0" />
60+
</ItemGroup>
61+
<ItemGroup>
62+
<None Update="host.json">
63+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
64+
</None>
65+
<None Update="local.settings.json">
66+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
67+
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
68+
</None>
69+
</ItemGroup>
70+
</Project>
71+
```
72+
73+
The following is an example of a minimal `local.settings.json` file with these changes:
74+
75+
```json
76+
{
77+
"IsEncrypted": false,
78+
"Values": {
79+
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
80+
"FUNCTIONS_INPROC_NET8_ENABLED": "1",
81+
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
82+
}
83+
}
84+
```
85+
86+
You might need to make other changes to your app based on the version support of its dependencies.
87+
3288
## Functions class library project
3389

3490
In Visual Studio, the **Azure Functions** project template creates a C# class library project that contains the following files:
@@ -165,11 +221,11 @@ The following example shows the relevant parts of the `.csproj` files that have
165221

166222
```xml
167223
<PropertyGroup>
168-
<TargetFramework>net6.0</TargetFramework>
224+
<TargetFramework>net8.0</TargetFramework>
169225
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
170226
</PropertyGroup>
171227
<ItemGroup>
172-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
228+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.0" />
173229
</ItemGroup>
174230
```
175231

@@ -212,7 +268,7 @@ To compile your project as ReadyToRun, update your project file by adding the `<
212268

213269
```xml
214270
<PropertyGroup>
215-
<TargetFramework>net6.0</TargetFramework>
271+
<TargetFramework>net8.0</TargetFramework>
216272
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
217273
<PublishReadyToRun>true</PublishReadyToRun>
218274
<RuntimeIdentifier>win-x86</RuntimeIdentifier>

articles/azure-functions/functions-versions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ zone_pivot_groups: programming-languages-set-functions
1818
| Version | Support level | Description |
1919
| --- | --- | --- |
2020
| 4.x | GA | **_Recommended runtime version for functions in all languages._** Check out [Supported language versions](#languages). |
21-
| 1.x | GA ([support ends September 14, 2026](https://aka.ms/azure-functions-retirements/hostv1)) | Supported only for C# apps that must use .NET Framework. This version is in maintenance mode, with enhancements provided only in later versions. **Support will end for version 1.x on September 14, 2026.** We highly recommend you [migrate your apps to version 4.x](migrate-version-1-version-4.md?pivots=programming-language-csharp), which supports .NET Framework 4.8, .NET 6, .NET 7, and .NET 8.|
21+
| 1.x | GA ([support ends September 14, 2026](https://aka.ms/azure-functions-retirements/hostv1)) | Supported only for C# apps that must use .NET Framework. This version is in maintenance mode, with enhancements provided only in later versions. **Support will end for version 1.x on September 14, 2026.** We highly recommend you [migrate your apps to version 4.x](migrate-version-1-version-4.md?pivots=programming-language-csharp), which supports .NET Framework 4.8, .NET 6, and .NET 8.|
2222

2323
> [!IMPORTANT]
2424
> As of December 13, 2022, function apps running on versions 2.x and 3.x of the Azure Functions runtime have reached the end of extended support. For more information, see [Retired versions](#retired-versions).
@@ -135,7 +135,7 @@ In Visual Studio, you select the runtime version when you create a project. Azur
135135
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
136136
```
137137

138-
You can choose `net8.0`, `net6.0`, or `net48` as the target framework if you are using the [isolated worker model](dotnet-isolated-process-guide.md). If you are using the [in-process model](./functions-dotnet-class-library.md), you can only choose `net6.0`, and you must include the `Microsoft.NET.Sdk.Functions` extension set to at least `4.0.0`.
138+
You can choose `net8.0`, `net6.0`, or `net48` as the target framework if you are using the [isolated worker model](dotnet-isolated-process-guide.md). If you are using the [in-process model](./functions-dotnet-class-library.md), you can choose `net8.0` or `net6.0`, and you must include the `Microsoft.NET.Sdk.Functions` extension set to at least `4.4.0`.
139139

140140
.NET 7 was previously supported on the isolated worker model but reached the end of official support on [May 14, 2024][dotnet-policy].
141141

articles/azure-functions/migrate-version-1-version-4.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ On version 1.x of the Functions runtime, your C# function app targets .NET Frame
8686
>
8787
> Although you can choose to instead use the in-process model, this is not recommended if it can be avoided. [Support will end for the in-process model on November 10, 2026](https://aka.ms/azure-functions-retirements/in-process-model), so you'll need to move to the isolated worker model before then. Doing so while migrating to version 4.x will decrease the total effort required, and the isolated worker model will give your app [additional benefits](./dotnet-isolated-in-process-differences.md), including the ability to more easily target future versions of .NET. If you are moving to the isolated worker model, the [.NET Upgrade Assistant] can also handle many of the necessary code changes for you.
8888
89-
This guide doesn't present specific examples for .NET 6 on the isolated worker model. If you need to target that version, you can adapt the .NET 8 isolated worker model examples.
89+
This guide doesn't present specific examples for .NET 6. If you need to target that version, you can adapt the .NET 8 examples.
9090

9191
::: zone-end
9292

@@ -167,7 +167,7 @@ Use one of the following procedures to update this XML file to run in Functions
167167

168168
[!INCLUDE [functions-dotnet-migrate-project-v4-isolated-net-framework](../../includes/functions-dotnet-migrate-project-v4-isolated-net-framework.md)]
169169

170-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
170+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
171171

172172
[!INCLUDE [functions-dotnet-migrate-project-v4-inproc](../../includes/functions-dotnet-migrate-project-v4-inproc.md)]
173173

@@ -185,7 +185,7 @@ Based on the model you are migrating to, you might need to update or change the
185185

186186
[!INCLUDE [functions-dotnet-migrate-packages-v4-isolated](../../includes/functions-dotnet-migrate-packages-v4-isolated.md)]
187187

188-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
188+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
189189

190190
[!INCLUDE [functions-dotnet-migrate-packages-v4-in-process](../../includes/functions-dotnet-migrate-packages-v4-in-process.md)]
191191

@@ -248,7 +248,7 @@ namespace Company.FunctionApp
248248

249249
[!INCLUDE [functions-dotnet-migrate-isolated-program-cs](../../includes/functions-dotnet-migrate-isolated-program-cs.md)]
250250

251-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
251+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
252252

253253
A program.cs file isn't required when running in-process.
254254

@@ -272,7 +272,7 @@ The `host.json` file only controls logging from the Functions host runtime, and
272272

273273
The `host.json` file only controls logging from the Functions host runtime, and in the isolated worker model, some of these logs come from your application directly, giving you more control. See [Managing log levels in the isolated worker model](./dotnet-isolated-process-guide.md#managing-log-levels) for details on how to filter these logs.
274274

275-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
275+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
276276

277277
:::code language="json" source="~/functions-quickstart-templates/Functions.Templates/ProjectTemplate_v4.x/CSharp/host.json":::
278278

@@ -300,18 +300,22 @@ When you migrate to version 4.x, make sure that your local.settings.json file ha
300300
> [!NOTE]
301301
> When migrating from running in-process to running in an isolated worker process, you need to change the `FUNCTIONS_WORKER_RUNTIME` value to "dotnet-isolated".
302302
303-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
303+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
304304

305305
```json
306306
{
307307
"IsEncrypted": false,
308308
"Values": {
309309
"AzureWebJobsStorage": "AzureWebJobsStorageConnectionStringValue",
310-
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
310+
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
311+
"FUNCTIONS_INPROC_NET8_ENABLED": "1"
311312
}
312313
}
313314
```
314315

316+
> [!NOTE]
317+
> When choosing to target .NET 8 using the in-process model, you need to set the `FUNCTIONS_WORKER_RUNTIME` value to "dotnet" and set the `FUNCTIONS_INPROC_NET8_ENABLED` value to "1".
318+
315319
---
316320

317321
### Class name changes
@@ -337,7 +341,7 @@ Some key classes changed names between version 1.x and version 4.x. These change
337341
| `HttpRequestMessage` | `HttpRequestData` |
338342
| `HttpResponseMessage` | `HttpResponseData` |
339343

340-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
344+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
341345

342346
| Version 1.x | .NET 6 (in-process) |
343347
| --- | --- |
@@ -360,7 +364,7 @@ This section highlights other code changes to consider as you work through the m
360364

361365
[!INCLUDE [functions-dotnet-migrate-isolated-other-code-changes](../../includes/functions-dotnet-migrate-isolated-other-code-changes.md)]
362366

363-
# [.NET 6 (in-process)](#tab/net6-in-proc)
367+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
364368

365369
Make sure to check [Behavior changes after version 1.x](#behavior-changes-after-version-1x) for additional changes you might need to make to your project.
366370

@@ -485,7 +489,7 @@ namespace Company.Function
485489
}
486490
```
487491

488-
# [.NET 6 (in-process model)](#tab/net6-in-proc)
492+
# [.NET 8 (in-process model)](#tab/net8-in-proc)
489493

490494
:::code language="csharp" source="~/functions-quickstart-templates/Functions.Templates/Templates/HttpTrigger-CSharp/HttpTriggerCSharp.cs":::
491495

0 commit comments

Comments
 (0)