Skip to content

Commit 51cbdb2

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into redirect
2 parents fd791bd + 8d432ba commit 51cbdb2

File tree

80 files changed

+2638
-2896
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2638
-2896
lines changed

articles/azure-functions/TOC.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@
381381
href: supported-languages.md
382382
- name: C#
383383
items:
384-
- name: In-process
385-
href: functions-dotnet-class-library.md
386-
- name: Isolated worker process
387-
displayName: .NET isolated, .NET 5
384+
- name: Isolated worker model
385+
displayName: .NET isolated
388386
href: dotnet-isolated-process-guide.md
387+
- name: In-process model
388+
href: functions-dotnet-class-library.md
389389
- name: Script (.csx)
390390
href: functions-reference-csharp.md
391391
- name: Execution mode comparison

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ recommendations: false
99
#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.
1010
---
1111

12-
# Differences between in-process and isolated worker process .NET Azure Functions
12+
# Differences between isolated worker model and in-process model .NET Azure Functions
1313

1414
There are two process models for .NET functions:
1515

@@ -21,23 +21,23 @@ This article describes the current state of the functional and behavioral differ
2121

2222
Use the following table to compare feature and functional differences between the two models:
2323

24-
| Feature/behavior | In-process<sup>3</sup> | Isolated worker process |
24+
| Feature/behavior | Isolated worker process | In-process<sup>3</sup> |
2525
| ---- | ---- | ---- |
26-
| [Supported .NET versions](#supported-versions) | Long Term Support (LTS) versions<sup>6</sup> | Long Term Support (LTS) versions<sup>6</sup>,<br/>Standard Term Support (STS) versions,<br/>.NET Framework |
27-
| 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) |
28-
| 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) |
29-
| Durable Functions | [Supported](durable/durable-functions-overview.md) | [Supported](durable/durable-functions-isolated-create-first-csharp.md?pivots=code-editor-visualstudio) (Support does not yet include Durable Entities) |
30-
| Model types exposed by bindings | Simple types<br/>[JSON serializable](/dotnet/api/system.text.json.jsonserializeroptions) types<br/>Arrays/enumerations<br/>Service SDK types<sup>4</sup> | Simple types<br/>JSON serializable types<br/>Arrays/enumerations<br/>[Service SDK types](dotnet-isolated-process-guide.md#sdk-types)<sup>4</sup> |
31-
| HTTP trigger model types| [HttpRequest] / [IActionResult]<sup>5</sup><br/>[HttpRequestMessage] / [HttpResponseMessage] | [HttpRequestData] / [HttpResponseData]<br/>[HttpRequest] / [IActionResult] (using [ASP.NET Core integration][aspnetcore-integration])<sup>5</sup>|
32-
| Output binding interactions | Return values (single output only),<br/>`out` parameters,<br/>`IAsyncCollector` | Return values in an expanded model with:<br/> - single or [multiple outputs](dotnet-isolated-process-guide.md#multiple-output-bindings)<br/> - arrays of outputs|
33-
| Imperative bindings<sup>1</sup> | [Supported](functions-dotnet-class-library.md#binding-at-runtime) | Not supported - instead [work with SDK types directly](./dotnet-isolated-process-guide.md#register-azure-clients) |
34-
| Dependency injection | [Supported](functions-dotnet-dependency-injection.md) | [Supported](dotnet-isolated-process-guide.md#dependency-injection) (improved model consistent with .NET ecosystem) |
35-
| Middleware | Not supported | [Supported](dotnet-isolated-process-guide.md#middleware) |
36-
| Logging | [ILogger] passed to the function<br/>[ILogger&lt;T&gt;] via [dependency injection](functions-dotnet-dependency-injection.md) | [ILogger&lt;T&gt;]/[ILogger] obtained from [FunctionContext](/dotnet/api/microsoft.azure.functions.worker.functioncontext) or via [dependency injection](dotnet-isolated-process-guide.md#dependency-injection)|
37-
| Application Insights dependencies | [Supported](functions-monitoring.md#dependencies) | [Supported](./dotnet-isolated-process-guide.md#application-insights) |
38-
| Cancellation tokens | [Supported](functions-dotnet-class-library.md#cancellation-tokens) | [Supported](dotnet-isolated-process-guide.md#cancellation-tokens) |
39-
| Cold start times<sup>2</sup> | Optimized | [Configurable optimizations (preview)](./dotnet-isolated-process-guide.md#performance-optimizations) |
40-
| ReadyToRun | [Supported](functions-dotnet-class-library.md#readytorun) | [Supported](dotnet-isolated-process-guide.md#readytorun) |
26+
| [Supported .NET versions](#supported-versions) | Long Term Support (LTS) versions<sup>6</sup>,<br/>Standard Term Support (STS) versions,<br/>.NET Framework | Long Term Support (LTS) versions<sup>6</sup> |
27+
| 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/) |
28+
| 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) |
29+
| Durable Functions | [Supported](durable/durable-functions-isolated-create-first-csharp.md?pivots=code-editor-visualstudio) (Support does not yet include Durable Entities) | [Supported](durable/durable-functions-overview.md) |
30+
| Model types exposed by bindings | Simple types<br/>JSON serializable types<br/>Arrays/enumerations<br/>[Service SDK types](dotnet-isolated-process-guide.md#sdk-types)<sup>4</sup> | Simple types<br/>[JSON serializable](/dotnet/api/system.text.json.jsonserializeroptions) types<br/>Arrays/enumerations<br/>Service SDK types<sup>4</sup> |
31+
| HTTP trigger model types| [HttpRequestData] / [HttpResponseData]<br/>[HttpRequest] / [IActionResult] (using [ASP.NET Core integration][aspnetcore-integration])<sup>5</sup>| [HttpRequest] / [IActionResult]<sup>5</sup><br/>[HttpRequestMessage] / [HttpResponseMessage] |
32+
| Output binding interactions | Return values in an expanded model with:<br/> - single or [multiple outputs](dotnet-isolated-process-guide.md#multiple-output-bindings)<br/> - arrays of outputs| Return values (single output only),<br/>`out` parameters,<br/>`IAsyncCollector` |
33+
| Imperative bindings<sup>1</sup> | Not supported - instead [work with SDK types directly](./dotnet-isolated-process-guide.md#register-azure-clients) | [Supported](functions-dotnet-class-library.md#binding-at-runtime) |
34+
| Dependency injection | [Supported](dotnet-isolated-process-guide.md#dependency-injection) (improved model consistent with .NET ecosystem) | [Supported](functions-dotnet-dependency-injection.md) |
35+
| Middleware | [Supported](dotnet-isolated-process-guide.md#middleware) | Not supported |
36+
| Logging | [ILogger&lt;T&gt;]/[ILogger] obtained from [FunctionContext](/dotnet/api/microsoft.azure.functions.worker.functioncontext) or via [dependency injection](dotnet-isolated-process-guide.md#dependency-injection)| [ILogger] passed to the function<br/>[ILogger&lt;T&gt;] via [dependency injection](functions-dotnet-dependency-injection.md) |
37+
| Application Insights dependencies | [Supported](./dotnet-isolated-process-guide.md#application-insights) | [Supported](functions-monitoring.md#dependencies) |
38+
| Cancellation tokens | [Supported](dotnet-isolated-process-guide.md#cancellation-tokens) | [Supported](functions-dotnet-class-library.md#cancellation-tokens) |
39+
| Cold start times<sup>2</sup> | [Configurable optimizations (preview)](./dotnet-isolated-process-guide.md#performance-optimizations) | Optimized |
40+
| ReadyToRun | [Supported](dotnet-isolated-process-guide.md#readytorun) | [Supported](functions-dotnet-class-library.md#readytorun) |
4141

4242
<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.
4343

articles/azure-functions/functions-add-output-binding-azure-sql-vs-code.md

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ Because you're using an Azure SQL output binding, you must have the correspondin
8989

9090
With the exception of HTTP and timer triggers, bindings are implemented as extension packages. Run the following [dotnet add package](/dotnet/core/tools/dotnet-add-package) command in the Terminal window to add the Azure SQL extension package to your project.
9191

92-
# [In-process](#tab/in-process)
92+
# [Isolated worker model](#tab/isolated-process)
9393
```bash
94-
dotnet add package Microsoft.Azure.WebJobs.Extensions.Sql
94+
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Sql
9595
```
96-
# [Isolated process](#tab/isolated-process)
96+
# [In-process model](#tab/in-process)
9797
```bash
98-
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.Sql
98+
dotnet add package Microsoft.Azure.WebJobs.Extensions.Sql
9999
```
100100
---
101101
::: zone-end
@@ -131,14 +131,7 @@ Open the *HttpExample.cs* project file and add the following `ToDoItem` class, w
131131

132132
In a C# class library project, the bindings are defined as binding attributes on the function method. The *function.json* file required by Functions is then auto-generated based on these attributes.
133133

134-
# [In-process](#tab/in-process)
135-
Open the *HttpExample.cs* project file and add the following parameter to the `Run` method definition:
136-
137-
:::code language="csharp" source="~/functions-sql-todo-sample/PostToDo.cs" range="25":::
138-
139-
The `toDoItems` parameter is an `IAsyncCollector<ToDoItem>` type, which represents a collection of ToDo items that are written to your Azure SQL Database when the function completes. Specific attributes indicate the names of the database table (`dbo.ToDo`) and the connection string for your Azure SQL Database (`SqlConnectionString`).
140-
141-
# [Isolated process](#tab/isolated-process)
134+
# [Isolated worker model](#tab/isolated-process)
142135

143136
Open the *HttpExample.cs* project file and add the following output type class, which defines the combined objects that will be output from our function for both the HTTP response and the SQL output:
144137

@@ -157,6 +150,13 @@ Add a using statement to the `Microsoft.Azure.Functions.Worker.Extensions.Sql` l
157150
using Microsoft.Azure.Functions.Worker.Extensions.Sql;
158151
```
159152

153+
# [In-process model](#tab/in-process)
154+
Open the *HttpExample.cs* project file and add the following parameter to the `Run` method definition:
155+
156+
:::code language="csharp" source="~/functions-sql-todo-sample/PostToDo.cs" range="25":::
157+
158+
The `toDoItems` parameter is an `IAsyncCollector<ToDoItem>` type, which represents a collection of ToDo items that are written to your Azure SQL Database when the function completes. Specific attributes indicate the names of the database table (`dbo.ToDo`) and the connection string for your Azure SQL Database (`SqlConnectionString`).
159+
160160
---
161161

162162
::: zone-end
@@ -247,7 +247,40 @@ In this code, `arg_name` identifies the binding parameter referenced in your cod
247247

248248
::: zone pivot="programming-language-csharp"
249249

250-
# [In-process](#tab/in-process)
250+
# [Isolated worker model](#tab/isolated-process)
251+
252+
Replace the existing Run method with the following code:
253+
254+
```cs
255+
[Function("HttpExample")]
256+
public static OutputType Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req,
257+
FunctionContext executionContext)
258+
{
259+
var logger = executionContext.GetLogger("HttpExample");
260+
logger.LogInformation("C# HTTP trigger function processed a request.");
261+
262+
var message = "Welcome to Azure Functions!";
263+
264+
var response = req.CreateResponse(HttpStatusCode.OK);
265+
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
266+
response.WriteString(message);
267+
268+
// Return a response to both HTTP trigger and Azure SQL output binding.
269+
return new OutputType()
270+
{
271+
ToDoItem = new ToDoItem
272+
{
273+
id = System.Guid.NewGuid().ToString(),
274+
title = message,
275+
completed = false,
276+
url = ""
277+
},
278+
HttpResponse = response
279+
};
280+
}
281+
```
282+
283+
# [In-process model](#tab/in-process)
251284

252285
Add code that uses the `toDoItems` output binding object to create a new `ToDoItem`. Add this code before the method returns.
253286

@@ -304,39 +337,6 @@ public static async Task<IActionResult> Run(
304337
}
305338
```
306339

307-
# [Isolated process](#tab/isolated-process)
308-
309-
Replace the existing Run method with the following code:
310-
311-
```cs
312-
[Function("HttpExample")]
313-
public static OutputType Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req,
314-
FunctionContext executionContext)
315-
{
316-
var logger = executionContext.GetLogger("HttpExample");
317-
logger.LogInformation("C# HTTP trigger function processed a request.");
318-
319-
var message = "Welcome to Azure Functions!";
320-
321-
var response = req.CreateResponse(HttpStatusCode.OK);
322-
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
323-
response.WriteString(message);
324-
325-
// Return a response to both HTTP trigger and Azure SQL output binding.
326-
return new OutputType()
327-
{
328-
ToDoItem = new ToDoItem
329-
{
330-
id = System.Guid.NewGuid().ToString(),
331-
title = message,
332-
completed = false,
333-
url = ""
334-
},
335-
HttpResponse = response
336-
};
337-
}
338-
```
339-
340340
---
341341

342342
::: zone-end

articles/azure-functions/functions-add-output-binding-cosmos-db-vs-code.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ Because you're using an Azure Cosmos DB output binding, you must have the corres
9494

9595
Except for HTTP and timer triggers, bindings are implemented as extension packages. Run the following [dotnet add package](/dotnet/core/tools/dotnet-add-package) command in the Terminal window to add the Azure Cosmos DB extension package to your project.
9696

97-
# [In-process](#tab/in-process)
97+
# [Isolated worker model](#tab/isolated-process)
9898
```command
99-
dotnet add package Microsoft.Azure.WebJobs.Extensions.CosmosDB --version 3.0.10
99+
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.CosmosDB --version 3.0.9
100100
```
101-
# [Isolated process](#tab/isolated-process)
101+
# [In-process model](#tab/in-process)
102102
```command
103-
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.CosmosDB --version 3.0.9
103+
dotnet add package Microsoft.Azure.WebJobs.Extensions.CosmosDB --version 3.0.10
104104
```
105105
---
106106
::: zone-end
@@ -121,14 +121,7 @@ Now, you can add the Azure Cosmos DB output binding to your project.
121121
::: zone pivot="programming-language-csharp"
122122
In a C# class library project, the bindings are defined as binding attributes on the function method.
123123

124-
# [In-process](#tab/in-process)
125-
Open the *HttpExample.cs* project file and add the following parameter to the `Run` method definition:
126-
127-
:::code language="csharp" source="~/functions-docs-csharp/functions-add-output-binding-cosmos-db/HttpExample.cs" range="18-20":::
128-
129-
The `documentsOut` parameter is an `IAsyncCollector<T>` type, which represents a collection of JSON documents that are written to your Azure Cosmos DB container when the function completes. Specific attributes indicate the names of the container and its parent database. The connection string for your Azure Cosmos DB account is set by the `ConnectionStringSettingAttribute`.
130-
131-
# [Isolated process](#tab/isolated-process)
124+
# [Isolated worker model](#tab/isolated-process)
132125

133126
Open the *HttpExample.cs* project file and add the following classes:
134127

@@ -138,6 +131,13 @@ The `MyDocument` class defines an object that gets written to the database. The
138131

139132
The `MultiResponse` class allows you to both write to the specified collection in the Azure Cosmos DB and return an HTTP success message. Because you need to return a `MultiResponse` object, you need to also update the method signature.
140133

134+
# [In-process model](#tab/in-process)
135+
Open the *HttpExample.cs* project file and add the following parameter to the `Run` method definition:
136+
137+
:::code language="csharp" source="~/functions-docs-csharp/functions-add-output-binding-cosmos-db/HttpExample.cs" range="18-20":::
138+
139+
The `documentsOut` parameter is an `IAsyncCollector<T>` type, which represents a collection of JSON documents that are written to your Azure Cosmos DB container when the function completes. Specific attributes indicate the names of the container and its parent database. The connection string for your Azure Cosmos DB account is set by the `ConnectionStringSettingAttribute`.
140+
141141
---
142142

143143
Specific attributes specify the name of the container and the name of its parent database. The connection string for your Azure Cosmos DB account is set by the `CosmosDbConnectionString`.
@@ -233,7 +233,13 @@ In this code, `arg_name` identifies the binding parameter referenced in your cod
233233

234234
::: zone pivot="programming-language-csharp"
235235

236-
# [In-process](#tab/in-process)
236+
# [Isolated worker model](#tab/isolated-process)
237+
238+
Replace the existing Run method with the following code:
239+
240+
:::code language="csharp" source="~/functions-docs-csharp/functions-add-output-binding-cosmos-db-isolated/HttpExample.cs" range="11-34":::
241+
242+
# [In-process model](#tab/in-process)
237243

238244
Add code that uses the `documentsOut` output binding object to create a JSON document. Add this code before the method returns.
239245

@@ -289,12 +295,6 @@ public static async Task<IActionResult> Run(
289295
}
290296
```
291297

292-
# [Isolated process](#tab/isolated-process)
293-
294-
Replace the existing Run method with the following code:
295-
296-
:::code language="csharp" source="~/functions-docs-csharp/functions-add-output-binding-cosmos-db-isolated/HttpExample.cs" range="11-34":::
297-
298298
---
299299

300300
::: zone-end

articles/azure-functions/functions-add-output-binding-storage-queue-vs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ Because you're using a Queue storage output binding, you need the Storage bindin
4646

4747
1. In the console, run the following [Install-Package](/nuget/tools/ps-ref-install-package) command to install the Storage extensions:
4848

49-
# [In-process](#tab/in-process)
49+
# [Isolated worker model](#tab/isolated-process)
5050
```bash
51-
Install-Package Microsoft.Azure.WebJobs.Extensions.Storage
51+
Install-Package /dotnet/api/microsoft.azure.webjobs.blobattribute.Queues -IncludePrerelease
5252
```
53-
# [Isolated process](#tab/isolated-process)
53+
# [In-process model](#tab/in-process)
5454
```bash
55-
Install-Package /dotnet/api/microsoft.azure.webjobs.blobattribute.Queues -IncludePrerelease
55+
Install-Package Microsoft.Azure.WebJobs.Extensions.Storage
5656
```
5757
---
5858

0 commit comments

Comments
 (0)