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/functions-bindings-http-webhook-output.md
+8-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,12 @@ ms.author: cshoe
10
10
11
11
# Azure Functions HTTP output bindings
12
12
13
-
Use the HTTP output binding to respond to the HTTP request sender. This binding requires an HTTP trigger and allows you to customize the response associated with the trigger's request. If an HTTP output binding is not provided, an HTTP trigger returns HTTP 200 OK with an empty body in Functions 1.x, or HTTP 204 No Content with an empty body in Functions 2.x and higher.
13
+
Use the HTTP output binding to respond to the HTTP request sender. This binding requires an HTTP trigger and allows you to customize the response associated with the trigger's request.
14
+
15
+
The default return value for an HTTP-triggered function is:
16
+
17
+
-`HTTP 204 No Content` with an empty body in Functions 2.x and higher
18
+
-`HTTP 200 OK` with an empty body in Functions 1.x
14
19
15
20
## Output - configuration
16
21
@@ -58,9 +63,9 @@ This section describes the global configuration settings available for this bind
58
63
|Property |Default | Description |
59
64
|---------|---------|---------|
60
65
| customHeaders|none|Allows you to set custom headers in the HTTP response. The previous example adds the `X-Content-Type-Options` header to the response to avoid content type sniffing. |
61
-
|dynamicThrottlesEnabled|true<sup>\*</sup>|When enabled, this setting causes the request processing pipeline to periodically check system performance counters like connections/threads/processes/memory/cpu/etc. and if any of those counters are over a built-in high threshold (80%), requests will be rejected with a 429 "Too Busy" response until the counter(s) return to normal levels.<br/><sup>\*</sup>The default in a Consumption plan is `true`. The default in a Dedicated plan is `false`.|
66
+
|dynamicThrottlesEnabled|true<sup>\*</sup>|When enabled, this setting causes the request processing pipeline to periodically check system performance counters like `connections/threads/processes/memory/cpu/etc` and if any of those counters are over a built-in high threshold (80%), requests will be rejected with a `429 "Too Busy"` response until the counter(s) return to normal levels.<br/><sup>\*</sup>The default in a Consumption plan is `true`. The default in a Dedicated plan is `false`.|
62
67
|hsts|not enabled|When `isEnabled` is set to `true`, the [HTTP Strict Transport Security (HSTS) behavior of .NET Core](/aspnet/core/security/enforcing-ssl?view=aspnetcore-3.0&tabs=visual-studio#hsts) is enforced, as defined in the [`HstsOptions` class](/dotnet/api/microsoft.aspnetcore.httpspolicy.hstsoptions?view=aspnetcore-3.0). The above example also sets the [`maxAge`](/dotnet/api/microsoft.aspnetcore.httpspolicy.hstsoptions.maxage?view=aspnetcore-3.0#Microsoft_AspNetCore_HttpsPolicy_HstsOptions_MaxAge) property to 10 days. Supported properties of `hsts` are: <table><tr><th>Property</th><th>Description</th></tr><tr><td>excludedHosts</td><td>A string array of host names for which the HSTS header isn't added.</td></tr><tr><td>includeSubDomains</td><td>Boolean value that indicates whether the includeSubDomain parameter of the Strict-Transport-Security header is enabled.</td></tr><tr><td>maxAge</td><td>String that defines the max-age parameter of the Strict-Transport-Security header.</td></tr><tr><td>preload</td><td>Boolean that indicates whether the preload parameter of the Strict-Transport-Security header is enabled.</td></tr></table>|
63
-
|maxConcurrentRequests|100<sup>\*</sup>|The maximum number of HTTP functions that are executed in parallel. This allows you to control concurrency, which can help manage resource utilization. For example, you might have an HTTP function that uses a lot of system resources (memory/cpu/sockets) such that it causes issues when concurrency is too high. Or you might have a function that makes outbound requests to a thirdparty service, and those calls need to be rate limited. In these cases, applying a throttle here can help. <br/><sup>*</sup>The default for a Consumption plan is 100. The default for a Dedicated plan is unbounded (`-1`).|
68
+
|maxConcurrentRequests|100<sup>\*</sup>|The maximum number of HTTP functions that are executed in parallel. This value allows you to control concurrency, which can help manage resource utilization. For example, you might have an HTTP function that uses a large number of system resources (memory/cpu/sockets) such that it causes issues when concurrency is too high. Or you might have a function that makes outbound requests to a third-party service, and those calls need to be rate limited. In these cases, applying a throttle here can help. <br/><sup>*</sup>The default for a Consumption plan is 100. The default for a Dedicated plan is unbounded (`-1`).|
64
69
|maxOutstandingRequests|200<sup>\*</sup>|The maximum number of outstanding requests that are held at any given time. This limit includes requests that are queued but have not started executing, as well as any in progress executions. Any incoming requests over this limit are rejected with a 429 "Too Busy" response. That allows callers to employ time-based retry strategies, and also helps you to control maximum request latencies. This only controls queuing that occurs within the script host execution path. Other queues such as the ASP.NET request queue will still be in effect and unaffected by this setting. <br/><sup>\*</sup>The default for a Consumption plan is 200. The default for a Dedicated plan is unbounded (`-1`).|
65
70
|routePrefix|api|The route prefix that applies to all routes. Use an empty string to remove the default prefix. |
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-http-webhook-trigger.md
+8-8
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ The default return value for an HTTP-triggered function is:
19
19
20
20
To modify the response, configure an [HTTP output binding](./functions-bindings-http-webhook-output.md).
21
21
22
-
Refer to the [overview](./functions-bindings-http-webhook-trigger.md) and [output binding reference](./functions-bindings-http-webhook-output.md) for more details.
22
+
For more information about HTTP bindings, see the [overview](./functions-bindings-http-webhook-trigger.md) and [output binding reference](./functions-bindings-http-webhook-output.md).
You can bind to a custom object instead of `HttpRequest`. This object is created from the body of the request and parsed as JSON. Similarly, a type can be passed to the HTTP response output binding and returned as the response body, along with a 200 status code.
107
+
You can bind to a custom object instead of `HttpRequest`. This object is created from the body of the request and parsed as JSON. Similarly, a type can be returned with a `200` response and [output](./functions-bindings-http-webhook-output.md) in the response body.
108
108
109
109
```csharp
110
110
usingSystem.Net;
@@ -418,7 +418,7 @@ public HttpResponseMessage run(
418
418
419
419
In [C# class libraries](functions-dotnet-class-library.md) and Java, the `HttpTrigger` attribute is available to configure the function.
420
420
421
-
You can set the authorization level and allowable HTTP methods in attribute constructor parameters, webhook type, and a route template. For more information about these settings, see [Trigger - configuration](#configuration).
421
+
You can set the authorization level and allowable HTTP methods a number of different ways. Options include attribute constructor parameters, webhook types, and route templates. For more information about these settings, see [Configuration](#configuration).
422
422
423
423
# [C#](#tab/csharp)
424
424
@@ -476,10 +476,10 @@ The following table explains the binding configuration properties that you set i
476
476
|**type**| n/a| Required - must be set to `httpTrigger`. |
477
477
|**direction**| n/a| Required - must be set to `in`. |
478
478
|**name**| n/a| Required - the variable name used in function code for the request or request body. |
479
-
| <aname="http-auth"></a>**authLevel**|**AuthLevel**|Determines what keys, if any, need to be present on the request in order to invoke the function. The authorization level can be one of the following values: <ul><li><code>anonymous</code>—No API key is required.</li><li><code>function</code>—A function-specific API key is required. This is the default value if none is provided.</li><li><code>admin</code>—The master key is required.</li></ul> For more information, see the section about [authorization keys](#authorization-keys). |
479
+
| <aname="http-auth"></a>**authLevel**|**AuthLevel**|Determines what keys, if any, need to be present on the request in order to invoke the function. The authorization level can be one of the following values: <ul><li><code>anonymous</code>—No API key is required.</li><li><code>function</code>—A function-specific API key is required (default)</li><li><code>admin</code>—The master key is required.</li></ul> For more information, see the section about [authorization keys](#authorization-keys). |
480
480
|**methods**|**Methods**| An array of the HTTP methods to which the function responds. If not specified, the function responds to all HTTP methods. See [customize the HTTP endpoint](#customize-the-http-endpoint). |
481
481
|**route**|**Route**| Defines the route template, controlling to which request URLs your function responds. The default value if none is provided is `<functionname>`. For more information, see [customize the HTTP endpoint](#customize-the-http-endpoint). |
482
-
| **webHookType** | **WebHookType** | _Supported only for the version 1.x runtime._<br/><br/>Configures the HTTP trigger to act as a [webhook](https://en.wikipedia.org/wiki/Webhook) receiver for the specified provider. Don't set the `methods` property if you set this property. The webhook type can be one of the following values:<ul><li><code>genericJson</code>—A general-purpose webhook endpoint without logic for a specific provider. This setting restricts requests to only those using HTTP POST and with the `application/json` content type.</li><li><code>github</code>—The function responds to [GitHub webhooks](https://developer.github.com/webhooks/). Do not use the _authLevel_ property with GitHub webhooks. For more information, see the GitHub webhooks section later in this article.</li><li><code>slack</code>—The function responds to [Slack webhooks](https://api.slack.com/outgoing-webhooks). Do not use the _authLevel_ property with Slack webhooks. For more information, see the Slack webhooks section later in this article.</li></ul>|
482
+
| **webHookType** | **WebHookType** | _Supported only for the version 1.x runtime._<br/><br/>Configures the HTTP trigger to act as a [webhook](https://en.wikipedia.org/wiki/Webhook) receiver for the specified provider. Don't set the `methods` property if you set this property. The webhook type can be one of the following values:<ul><li><code>genericJson</code>—A general-purpose webhook endpoint without logic for a specific provider. This setting restricts requests to only those using HTTP POST and with the `application/json` content type.</li><li><code>github</code>—The function responds to [GitHub webhooks](https://developer.github.com/webhooks/). Don't use the _authLevel_ property with GitHub webhooks. For more information, see the GitHub webhooks section later in this article.</li><li><code>slack</code>—The function responds to [Slack webhooks](https://api.slack.com/outgoing-webhooks). Don't use the _authLevel_ property with Slack webhooks. For more information, see the Slack webhooks section later in this article.</li></ul>|
483
483
484
484
## Usage
485
485
@@ -518,7 +518,7 @@ Using this configuration, the function is now addressable with the following rou
This allows the function code to support two parameters in the address, _category_ and _id_.
521
+
This configuration allows the function code to support two parameters in the address, _category_ and _id_.
522
522
523
523
# [C#](#tab/csharp)
524
524
@@ -778,7 +778,7 @@ Most HTTP trigger templates require an API key in the request. So your HTTP requ
778
778
779
779
The key can be included in a query string variable named `code`, as above. It can also be included in an `x-functions-key` HTTP header. The value of the key can be any function key defined for the function, or any host key.
780
780
781
-
You can allow anonymous requests, which do not require keys. You can also require that the master key be used. You change the default authorization level by using the `authLevel` property in the binding JSON. For more information, see [Trigger - configuration](#configuration).
781
+
You can allow anonymous requests, which do not require keys. You can also require that the master key is used. You change the default authorization level by using the `authLevel` property in the binding JSON. For more information, see [Trigger - configuration](#configuration).
782
782
783
783
> [!NOTE]
784
784
> When running functions locally, authorization is disabled regardless of the specified authorization level setting. After publishing to Azure, the `authLevel` setting in your trigger is enforced. Keys are still required when running [locally in a container](functions-create-function-linux-custom-image.md#build-the-container-image-and-test-locally).
@@ -788,7 +788,7 @@ You can allow anonymous requests, which do not require keys. You can also requir
788
788
789
789
To fully secure your function endpoints in production, you should consider implementing one of the following function app-level security options:
790
790
791
-
* Turn on App Service Authentication / Authorization for your function app. The App Service platform lets you use Azure Active Directory (AAD) and several third-party identity providers to authenticate clients. You can use this to implement custom authorization rules for your functions, and you can work with user information from your function code. To learn more, see [Authentication and authorization in Azure App Service](../app-service/overview-authentication-authorization.md) and [Working with client identities](#working-with-client-identities).
791
+
* Turn on App Service Authentication / Authorization for your function app. The App Service platform lets you use Azure Active Directory (AAD) and several third-party identity providers to authenticate clients. You can use this strategy to implement custom authorization rules for your functions, and you can work with user information from your function code. To learn more, see [Authentication and authorization in Azure App Service](../app-service/overview-authentication-authorization.md) and [Working with client identities](#working-with-client-identities).
792
792
793
793
* Use Azure API Management (APIM) to authenticate requests. APIM provides a variety of API security options for incoming requests. To learn more, see [API Management authentication policies](../api-management/api-management-authentication-policies.md). With APIM in place, you can configure your function app to accept requests only from the IP address of your APIM instance. To learn more, see [IP address restrictions](ip-addresses.md#ip-address-restrictions).
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-http-webhook.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ An HTTP trigger can be customized to respond to [webhooks](https://en.wikipedia.
16
16
17
17
[!INCLUDE [HTTP client best practices](../../includes/functions-http-client-best-practices.md)]
18
18
19
-
The code in this article defaults to the syntax which uses .NET Core, used in Functions version 2.x and higher. For information on the 1.x syntax, see the [1.x functions templates](https://github.com/Azure/azure-functions-templates/tree/v1.x/Functions.Templates/Templates).
19
+
The code in this article defaults to .NET Core syntax, used in Functions version 2.x and higher. For information on the 1.x syntax, see the [1.x functions templates](https://github.com/Azure/azure-functions-templates/tree/v1.x/Functions.Templates/Templates).
0 commit comments