You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/dotnet-isolated-process-guide.md
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Learn how to use a .NET isolated process to run your C# functions i
4
4
5
5
ms.service: azure-functions
6
6
ms.topic: conceptual
7
-
ms.date: 07/06/2022
7
+
ms.date: 09/29/2022
8
8
ms.custom: template-concept
9
9
recommendations: false
10
10
#Customer intent: As a developer, I need to know how to create functions that run in an isolated process so that I can run my function code on current (not LTS) releases of .NET.
@@ -136,6 +136,31 @@ The following is an example of a middleware implementation which reads the `Http
136
136
137
137
For a more complete example of using custom middleware in your function app, see the [custom middleware reference sample](https://github.com/Azure/azure-functions-dotnet-worker/blob/main/samples/CustomMiddleware).
138
138
139
+
## Cancellation tokens
140
+
141
+
A function can accept a [CancellationToken](/dotnet/api/system.threading.cancellationtoken) parameter, which enables the operating system to notify your code when the function is about to be terminated. You can use this notification to make sure the function doesn't terminate unexpectedly in a way that leaves data in an inconsistent state.
142
+
143
+
Cancellation tokens are supported in .NET functions when running in an isolated process. The following example shows how to use a cancellation token in a function:
You can compile your function app as [ReadyToRun binaries](/dotnet/core/deploying/ready-to-run). ReadyToRun is a form of ahead-of-time compilation that can improve startup performance to help reduce the impact of [cold-start](event-driven-scaling.md#cold-start) when running in a [Consumption plan](consumption-plan.md).
150
+
151
+
ReadyToRun is available in .NET 3.1, .NET 6 (both in-process and isolated process), and .NET 7, and it requires [version 3.0 or later](functions-versions.md) of the Azure Functions runtime.
152
+
153
+
To compile your project as ReadyToRun, update your project file by adding the `<PublishReadyToRun>` and `<RuntimeIdentifier>` elements. The following is the configuration for publishing to a Windows 32-bit function app.
154
+
155
+
```xml
156
+
<PropertyGroup>
157
+
<TargetFramework>net6.0</TargetFramework>
158
+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
159
+
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
160
+
<PublishReadyToRun>true</PublishReadyToRun>
161
+
</PropertyGroup>
162
+
```
163
+
139
164
## Execution context
140
165
141
166
.NET isolated passes a [FunctionContext] object to your function methods. This object lets you get an [ILogger] instance to write to the logs by calling the [GetLogger] method and supplying a `categoryName` string. To learn more, see [Logging](#logging).
@@ -251,7 +276,7 @@ This section describes the current state of the functional and behavioral differ
@@ -263,9 +288,9 @@ This section describes the current state of the functional and behavioral differ
263
288
| Middleware | Not supported |[Supported](#middleware)|
264
289
| Logging |[ILogger] passed to the function<br/>[ILogger<T>] via dependency injection |[ILogger]/[ILogger<T>] obtained from [FunctionContext] or via [dependency injection](#dependency-injection)|
<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.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-dotnet-class-library.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,23 +215,23 @@ If you install the Core Tools using the Windows installer (MSI) package or by us
215
215
216
216
## ReadyToRun
217
217
218
-
You can compile your function app as [ReadyToRun binaries](/dotnet/core/whats-new/dotnet-core-3-0#readytorun-images). ReadyToRun is a form of ahead-of-time compilation that can improve startup performance to help reduce the impact of [cold-start](event-driven-scaling.md#cold-start) when running in a [Consumption plan](consumption-plan.md).
218
+
You can compile your function app as [ReadyToRun binaries](/dotnet/core/deploying/ready-to-run). ReadyToRun is a form of ahead-of-time compilation that can improve startup performance to help reduce the impact of [cold-start](event-driven-scaling.md#cold-start) when running in a [Consumption plan](consumption-plan.md).
219
219
220
-
ReadyToRun is available in .NET 3.0 and requires [version 3.0 of the Azure Functions runtime](functions-versions.md).
220
+
ReadyToRun is available in .NET 3.1 and .NET 6 (in-proc and isolated) and .NET 7 and requires [version 3.0 or 4.0 of the Azure Functions runtime](functions-versions.md).
221
221
222
222
To compile your project as ReadyToRun, update your project file by adding the `<PublishReadyToRun>` and `<RuntimeIdentifier>` elements. The following is the configuration for publishing to a Windows 32-bit function app.
223
223
224
224
```xml
225
225
<PropertyGroup>
226
-
<TargetFramework>netcoreapp3.1</TargetFramework>
227
-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
226
+
<TargetFramework>net6.0</TargetFramework>
227
+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
228
228
<PublishReadyToRun>true</PublishReadyToRun>
229
229
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
230
230
</PropertyGroup>
231
231
```
232
232
233
233
> [!IMPORTANT]
234
-
> ReadyToRun currently doesn't support cross-compilation. You must build your app on the same platform as the deployment target. Also, pay attention to the "bitness" that is configured in your function app. For example, if your function app in Azure is Windows 64-bit, you must compile your app on Windows with `win-x64` as the [runtime identifier](/dotnet/core/rid-catalog).
234
+
> Starting in .NET 6, support for Composite ReadyToRun compilation has been added. Check out [ReadyToRun Cross platform and architecture restrictions](/dotnet/core/deploying/ready-to-run).
235
235
236
236
You can also build your app with ReadyToRun from the command line. For more information, see the `-p:PublishReadyToRun=true` option in [`dotnet publish`](/dotnet/core/tools/dotnet-publish).
0 commit comments