|
1 | 1 | --- |
2 | 2 | title: Configure gRPC on App Service |
3 | | -description: Learn how to configure a gRPC application with Azure App Service on Linux. |
| 3 | +description: Learn how to configure a Google Remote Procedure Call (gRPC) application with Azure App Service on Linux. |
4 | 4 | author: jefmarti |
5 | 5 | ms.topic: how-to |
6 | 6 | ms.custom: linux-related-content |
7 | | -ms.date: 11/10/2023 |
| 7 | +ms.date: 02/12/2026 |
8 | 8 | ms.author: jefmarti |
9 | 9 | ms.service: azure-app-service |
| 10 | +#customer intent: As an Azure App Service developer, I want to learn how to configure gRPC for my Linux apps so I can streamline messages between my clients and server over HTTP/2. |
| 11 | + |
10 | 12 | --- |
11 | 13 |
|
12 | 14 | # Configure gRPC on App Service |
13 | 15 |
|
14 | | -This article explains how to configure your web app for gRPC. |
15 | | - |
16 | | -gRPC is a Remote Procedure Call framework that can streamline messages between your client and server over HTTP/2. Using the gRPC protocol over HTTP/2 enables the use of features like: |
| 16 | +This article explains how to configure your web app for gRPC, a remote procedure call framework that can streamline messages between your client and server over HTTP/2. Using the gRPC protocol over HTTP/2 lets you use features like: |
17 | 17 |
|
18 | 18 | - Multiplexing to send multiple parallel requests over the same connection. |
19 | 19 | - Bidirectional streaming to send requests and responses simultaneously. |
20 | 20 |
|
21 | | -Support for gRPC is currently available on Azure App Service for Linux. To use gRPC on your web app, you need to configure your app by selecting the HTTP version, proxy, and port. |
| 21 | +Support for gRPC is available on Azure App Service for Linux. To use gRPC on your web app, you configure your app by selecting the HTTP version, proxy, and port. |
22 | 22 |
|
23 | | -For gRPC client and server samples for each supported language, see the [documentation on GitHub](https://github.com/Azure/app-service-linux-docs/tree/master/HowTo/gRPC). |
| 23 | +For gRPC client and server samples for each supported language, see [gRPC on App Service](https://github.com/Azure/app-service-linux-docs/tree/master/HowTo/gRPC) on GitHub. |
24 | 24 |
|
25 | 25 | ## Prerequisite |
26 | 26 |
|
27 | | -Create your [web app](getting-started.md) as you normally would. Choose your preferred runtime stack, and choose Linux as your operating system. |
| 27 | +- A Linux [web app](getting-started.md) in Azure App Service that uses your preferred runtime stack. |
| 28 | + |
| 29 | +## Configure gRPC |
28 | 30 |
|
29 | 31 | After you create your web app, configure the following details to enable gRPC before you deploy your application. |
30 | 32 |
|
31 | 33 | > [!NOTE] |
32 | | -> If you're deploying a .NET gRPC app to App Service by using Visual Studio, skip to [step 3](#3-configure-the-http2-port). Visual Studio sets the HTTP version and the HTTP 2.0 proxy configuration for you. |
33 | | -
|
34 | | -## 1. Configure the HTTP version |
| 34 | +> If you're deploying a .NET gRPC app to App Service by using Visual Studio, skip to [Configure the HTTP/2 port](#configure-the-http2-port), because Visual Studio sets the HTTP version and HTTP 2.0 proxy configuration for you. |
35 | 35 |
|
36 | | -The first setting that you need to configure is the HTTP version: |
| 36 | +### Configure the HTTP version and HTTP 2.0 proxy |
37 | 37 |
|
38 | | -1. On the left pane of your web app, under **Settings**, go to **Configuration**. |
39 | | -2. On the **General Settings** tab, scroll down to **Platform settings**. |
40 | | -3. In the **HTTP version** dropdown list, select **2.0**. |
41 | | -4. Select **Save**. |
| 38 | +Use the Azure portal page for your web app to configure your app's HTTP version and proxy. |
42 | 39 |
|
43 | | -This setting restarts your application and configures the front end to allow clients to make HTTP/2 calls. |
| 40 | +1. On the left navigation menu of your web app page, select **Settings** > **Configuration**. |
| 41 | +1. On the **General settings** tab of the **Stack settings** page, configure the following settings: |
| 42 | + - For **HTTP version**, select **2.0**. |
| 43 | + - For **HTTP 2.0 Proxy**, select **gRPC only**. |
| 44 | +1. Select **Apply**. |
44 | 45 |
|
45 | | -## 2. Configure the HTTP 2.0 proxy |
| 46 | +The **HTTP version** setting restarts your application and configures the front end to allow clients to make HTTP/2 calls. The **HTTP 2.0 Proxy** setting configures your site to receive HTTP/2 requests. |
46 | 47 |
|
47 | | -Next, you need to configure the HTTP 2.0 proxy: |
| 48 | +### Configure the HTTP/2 port |
48 | 49 |
|
49 | | -1. In the same **Platform settings** section, find the **HTTP 2.0 Proxy** setting and select **gRPC Only**. |
50 | | -2. Select **Save**. |
| 50 | +App Service requires an application setting that specifically listens for HTTP/2 traffic in addition to HTTP/1.1 traffic. Use **App settings** to define the HTTP/2 port. |
51 | 51 |
|
52 | | -This setting configures your site to receive HTTP/2 requests. |
| 52 | +1. On the left navigation menu of your web app page, select **Settings** > **Environmental variables**. |
| 53 | +1. On the **App settings** tab of the **Environmental variables** page, select **Add**. |
| 54 | +1. On the **Add/Edit application setting** screen, add the following app setting: |
| 55 | + - For **Name**, enter *HTTP20_ONLY_PORT*. |
| 56 | + - For **Value**, enter *8585*. |
| 57 | +1. Select **Apply**, and confirm that your application might restart if necessary. |
53 | 58 |
|
54 | | -## 3. Configure the HTTP/2 port |
| 59 | +This setting configures the port on your application that listens for HTTP/2 requests. |
55 | 60 |
|
56 | | -App Service requires an application setting that specifically listens for HTTP/2 traffic in addition to HTTP/1.1 traffic. You define the HTTP/2 port in the app settings: |
| 61 | +Now that you configured the HTTP version, port, and proxy, you can successfully make HTTP/2 calls to your web app by using gRPC. |
57 | 62 |
|
58 | | -1. On the left pane of your web app, under **Settings**, go to **Environment variables**. |
59 | | -2. On the **App settings** tab, add the following app settings to your application: |
60 | | - - **Name** = **HTTP20_ONLY_PORT** |
61 | | - - **Value** = **8585** |
| 63 | +### Provide a startup command |
62 | 64 |
|
63 | | -These settings configure the port on your application that's specified to listen for HTTP/2 requests. |
| 65 | +For Python applications, you must provide a custom startup command. For other languages, a startup command is optional. |
64 | 66 |
|
65 | | -Now that you've configured the HTTP version, port, and proxy, you can successfully make HTTP/2 calls to your web app by using gRPC. |
| 67 | +1. On the left navigation menu of your web app page, select **Settings** > **Configuration**. |
| 68 | +1. On the **Stack settings** page, select the **Stack settings** tab. |
| 69 | +1. Under **Startup command**, enter `python app.py`. |
| 70 | +1. Select **Apply**. |
66 | 71 |
|
67 | | -### (Optional) Python startup command |
| 72 | +## Requirements and limitations |
68 | 73 |
|
69 | | -For Python applications only, you also need to set a custom startup command: |
| 74 | +The following requirements and limitations apply to gRPC usage with App Service. |
70 | 75 |
|
71 | | -1. On the left pane of your web app, under **Settings**, go to **Configuration**. |
72 | | -2. Under **General Settings**, add the following value for **Startup Command**: `python app.py`. |
73 | | - |
74 | | -## Common topics |
75 | | - |
76 | | -The following table can answer your questions about using gRPC with App Service. |
77 | | - |
78 | | -> [!NOTE] |
79 | | -> gRPC is not a supported feature in App Service Environment v2. Use App Service Environment v3. |
80 | | -
|
81 | | -| Topic | Answer | |
82 | | -| --- | --- | |
83 | | -| OS support | gRPC is available on Linux. Windows support is currently in preview. | |
84 | | -| Language support | gRPC is supported for each language that supports gRPC. | |
85 | | -| Client certificates | HTTP/2 enabled on App Service doesn't currently support client certificates. Client certificates need to be ignored when you're using gRPC. | |
86 | | -| Secure calls | gRPC must make secure HTTP calls to App Service. You can't make nonsecure calls. | |
87 | | -| Activity timeout | gRPC requests on App Service have a timeout request limit. gRPC requests time out after 20 minutes of inactivity. | |
88 | | -| Custom containers | HTTP/2 and gRPC support is in addition to App Service HTTP/1.1 support. Custom containers that support HTTP/2 must also support HTTP/1.1. | |
| 76 | +- **App Service Environment version**. App Service Environment v2 doesn't support gRPC. Use App Service Environment v3. |
| 77 | +- **OS support**. gRPC is available on Linux. Windows support is currently in preview. |
| 78 | +- **Client certificates**. HTTP/2 on App Service doesn't support client certificates. Client certificates must be ignored when you use gRPC. |
| 79 | +- **Secure calls**. gRPC must make secure HTTP calls to App Service. You can't make nonsecure calls. |
| 80 | +- **Activity timeout**. App Service gRPC requests have a timeout request limit. gRPC requests time out after 20 minutes of inactivity. |
| 81 | +- **Custom containers**. HTTP/2 and gRPC support is in addition to App Service HTTP/1.1 support. Custom containers that support HTTP/2 must also support HTTP/1.1. |
0 commit comments