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
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -311,11 +311,42 @@ To write to an output binding, you must apply an output binding attribute to the
311
311
312
312
### Multiple output bindings
313
313
314
-
The data written to an output binding is always the return value of the function. If you need to write to more than one output binding, you must create a custom return type. This return type must have the output binding attribute applied to one or more properties of the class. The following example from an HTTP trigger writes to both the HTTP response and a queue output binding:
314
+
The data written to an output binding is always the return value of the function. If you need to write to more than one output binding, you must create a custom return type. This return type must have the output binding attribute applied to one or more properties of the class. The following example is an HTTP-triggered function using [ASP.NET Core integration](#aspnet-core-integration) which writes to both the HTTP response and a queue output binding:
_logger.LogInformation("C# HTTP trigger function processed a request.");
330
+
varmyObject=newMyOutputType
331
+
{
332
+
Result=newOkObjectResult("C# HTTP trigger function processed a request."),
333
+
MessageText="some output"
334
+
};
335
+
returnmyObject;
336
+
}
337
+
338
+
publicclassMyOutputType
339
+
{
340
+
[HttpResult]
341
+
publicIActionResultResult { get; set; }
342
+
343
+
[QueueOutput("myQueue")]
344
+
publicstringMessageText { get; set; }
345
+
}
346
+
}
347
+
```
317
348
318
-
The response from an HTTP trigger is always considered an output, so a return value attribute isn't required.
349
+
When using custom return types for multiple output bindings with ASP.NET Core integration, you must add the `[HttpResult]`attribute to the property that provides the result.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-http-webhook-output.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,15 @@ The default return value for an HTTP-triggered function is:
19
19
::: zone pivot="programming-language-csharp"
20
20
## Attribute
21
21
22
-
Both [in-process](functions-dotnet-class-library.md) and [isolated worker process](dotnet-isolated-process-guide.md) C# libraries don't require an attribute. C# script instead uses a function.json configuration file as described in the [C# scripting guide](./functions-reference-csharp.md#http-output).
23
-
24
22
# [Isolated worker model](#tab/isolated-process)
25
23
26
-
A return value attribute isn't required. To learn more, see [Usage](#usage).
24
+
A return value attribute isn't required when using [HttpResponseData]. However, when using a [ASP.NET Core integration](./dotnet-isolated-process-guide.md#aspnet-core-integration) and [multi-binding output objects](./dotnet-isolated-process-guide.md#multiple-output-bindings), the `[HttpResultAttribute]` attribute should be applied to the object property. The attribute takes no parameters. To learn more, see [Usage](#usage).
A return value attribute isn't required. To learn more, see [Usage](#usage).
30
+
A return value attribute isn't required for a [class library](functions-dotnet-class-library.md). C# script instead uses a function.json configuration file as described in the [C# scripting guide](./functions-reference-csharp.md#http-output). To learn more, see [Usage](#usage).
33
31
34
32
---
35
33
@@ -83,11 +81,21 @@ The following table explains the binding configuration properties that you set i
83
81
To send an HTTP response, use the language-standard response patterns.
84
82
85
83
::: zone pivot="programming-language-csharp"
86
-
The response type depends on the C# mode:
84
+
85
+
In .NET, the response type depends on the C# mode:
87
86
88
87
# [Isolated worker model](#tab/isolated-process)
89
88
90
-
The HTTP triggered function returns an [HttpResponseData](/dotnet/api/microsoft.azure.functions.worker.http.httpresponsedata) object or a `Task<HttpResponseData>`. If the app uses [ASP.NET Core integration in .NET Isolated](./dotnet-isolated-process-guide.md#aspnet-core-integration), it could also use [IActionResult], `Task<IActionResult>`, [HttpResponse], or `Task<HttpResponse>`.
89
+
The HTTP triggered function returns an object of one of the following types:
- JSON serializable types representing the response body for a `200 OK` response.
95
+
96
+
<sup>1</sup> This type is only available when using [ASP.NET Core integration](./dotnet-isolated-process-guide.md#aspnet-core-integration).
97
+
98
+
When one of these types is used as part of [multi-binding output objects](./dotnet-isolated-process-guide.md#multiple-output-bindings), the `[HttpResult]` attribute should be applied to the object property. The attribute takes no parameters.
Both [in-process](functions-dotnet-class-library.md) and [isolated worker process](dotnet-isolated-process-guide.md) C# libraries use the `HttpTriggerAttribute` to define the trigger binding. C# script instead uses a function.json configuration file as described in the [C# scripting guide](./functions-reference-csharp.md#http-trigger).
513
+
Both the [isolated worker model](dotnet-isolated-process-guide.md) and the [in-process model](functions-dotnet-class-library.md) use the `HttpTriggerAttribute` to define the trigger binding. C# script instead uses a function.json configuration file as described in the [C# scripting guide](./functions-reference-csharp.md#http-trigger).
514
514
515
515
# [Isolated worker model](#tab/isolated-process)
516
516
517
-
In [isolated worker process](dotnet-isolated-process-guide.md) function apps, the `HttpTriggerAttribute` supports the following parameters:
517
+
In [isolated worker model](dotnet-isolated-process-guide.md) function apps, the `HttpTriggerAttribute` supports the following parameters:
0 commit comments