Skip to content

Commit 50a1459

Browse files
author
gitName
committed
[APIM] HTTP/2 support
1 parent 2b32765 commit 50a1459

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

articles/api-management/forward-request-policy.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The `forward-request` policy forwards the incoming request to the backend servic
3535
| timeout | The amount of time in seconds to wait for the HTTP response headers to be returned by the backend service before a timeout error is raised. Minimum value is 0 seconds. Values greater than 240 seconds may not be honored, because the underlying network infrastructure can drop idle connections after this time. Policy expressions are allowed. You can specify either `timeout` or `timeout-ms` but not both. | No | 300 |
3636
| timeout-ms | The amount of time in milliseconds to wait for the HTTP response headers to be returned by the backend service before a timeout error is raised. Minimum value is 0 ms. Policy expressions are allowed. You can specify either `timeout` or `timeout-ms` but not both. | No | N/A |
3737
| continue-timeout | The amount of time in seconds to wait for a `100 Continue` status code to be returned by the backend service before a timeout error is raised. Policy expressions are allowed. | No | N/A |
38-
| http-version | The HTTP spec version to use when sending the HTTP response to the backend service. When using `2or1`, the gateway will favor HTTP /2 over /1, but fall back to HTTP /1 if HTTP /2 doesn't work. | No | 1 |
38+
| http-version | The HTTP protocol version to use when sending the HTTP request to the backend service: <br> - `1`: HTTP/1 <br> - `2`: HTTP/2 <br/> - `2or`: The gateway favors HTTP/2 over HTTP/1, but falls back to HTTP/1 if HTTP/2 doesn't work.<br/><br/> HTTP/2 support is in preview for only the self-hosted gateway and the v2 gateway. See [Usage notes](#usage-notes) for details. | No | 1 |
3939
| follow-redirects | Specifies whether redirects from the backend service are followed by the gateway or returned to the caller. Policy expressions are allowed. | No | `false` |
4040
| buffer-request-body | When set to `true`, request is buffered and will be reused on [retry](retry-policy.md). | No | `false` |
4141
| buffer-response | Affects processing of chunked responses. When set to `false`, each chunk received from the backend is immediately returned to the caller. When set to `true`, chunks are buffered (8 KB, unless end of stream is detected) and only then returned to the caller.<br/><br/>Set to `false` with backends such as those implementing [server-sent events (SSE)](how-to-server-sent-events.md) that require content to be returned or streamed immediately to the caller. Policy expressions aren't allowed. | No | `true` |
@@ -48,6 +48,16 @@ The `forward-request` policy forwards the incoming request to the backend servic
4848
- [**Policy scopes:**](./api-management-howto-policies.md#scopes) global, workspace, product, API, operation
4949
- [**Gateways:**](api-management-gateways-overview.md) classic, v2, consumption, self-hosted, workspace
5050

51+
### Usage notes
52+
53+
* Use the `http-version` attribute in this policy to enable the HTTP/2 protocol outbound from the gateway to the backend. Set the attribute to `2or1` or `2`. Currently, HTTP/2 support is in preview for only the self-hosted gateway and the v2 gateway.
54+
55+
> [!IMPORTANT]
56+
> In the v2 gateway, HTTP/2 is not supported end-to-end (that is, both inbound to API Management and outbound to the backend). HTTP/2-specific features such as trailers are dropped by the v2 gateway.
57+
58+
* In the self-hosted gateway, end-to-end HTTP/2 protocol support is required for [gRPC APIs](grpc-api.md).
59+
60+
5161
## Examples
5262

5363
### Send request to HTTP/2 backend
@@ -69,7 +79,6 @@ The following API level policy forwards all API requests to an HTTP/2 backend se
6979
</policies>
7080
```
7181

72-
This is required for HTTP /2 or gRPC workloads and currently only supported in self-hosted gateway. Learn more in our [API gateway overview](api-management-gateways-overview.md).
7382

7483
### Forward request with timeout interval
7584

articles/api-management/grpc-api.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: how-to
9-
ms.date: 05/06/2024
9+
ms.date: 07/21/2025
1010
ms.author: danlep
1111
ms.custom:
1212
- devx-track-arm-template
@@ -25,6 +25,7 @@ To add a gRPC API to API Management, you need to:
2525

2626
* Upload the API's Protobuf (protocol buffer) definition file to API Management
2727
* Specify the location of your gRPC service
28+
* Enable HTTP/2 support in the self-hosted gateway
2829
* Configure the API in API Management
2930

3031
API Management supports pass-through with the following types of gRPC service methods: unary, server streaming, client streaming, and bidirectional streaming. For background about gRPC, see [Introduction to gRPC](https://grpc.io/docs/what-is-grpc/introduction/).
@@ -76,6 +77,14 @@ API Management supports pass-through with the following types of gRPC service me
7677

7778
---
7879

80+
## Enable HTTP/2 support in the self-hosted gateway
81+
82+
gRPC requires HTTP/2 transport end to end (that is, both inbound to API Management and outbound from the gateway to the backend).
83+
84+
* The self-hosted gateway supports inbound HTTP/2 by default.
85+
86+
* Enable HTTP/2 protocol outbound support in the self-hosted gateway by setting the `http-version` attribute to `2` or `2or1` in the [forward-request](forward-request-policy.md) policy.
87+
7988
## Call gRPC services with .NET
8089

8190
For information about calling gRPC services with .NET, see the following articles:

0 commit comments

Comments
 (0)