|
| 1 | +--- |
| 2 | +title: Import a gRPC API to Azure API Management (preview) | Microsoft Docs |
| 3 | +description: Learn how to import a gRPC service definition as an API to an API Management instance using the Azure portal, ARM template, or bicep template. |
| 4 | +services: api-management |
| 5 | +author: dlepow |
| 6 | + |
| 7 | +ms.service: api-management |
| 8 | +ms.topic: how-to |
| 9 | +ms.date: 10/04/2023 |
| 10 | +ms.author: danlep |
| 11 | +ms.custom: |
| 12 | +--- |
| 13 | +# Import a gRPC API (preview) |
| 14 | + |
| 15 | +This article shows how to import a gRPC service definition as an API in API Management. You can then manage the API in API Management, secure access and apply other polices, and pass gRPC API requests through the gateway to the gRPC backend. |
| 16 | + |
| 17 | +To add a gRPC API to API Management, you need to: |
| 18 | + |
| 19 | +* Upload the API's Protobuf (protocol buffer) definition file to API Management |
| 20 | +* Specify the location of your gRPC service |
| 21 | +* Configure the API in API Management |
| 22 | + |
| 23 | +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/). |
| 24 | + |
| 25 | + |
| 26 | +> [!NOTE] |
| 27 | +> * Importing a gRPC API is in preview. Currently, gRPC APIs are only supported in the self-hosted gateway, not the managed gateway for your API Management instance. |
| 28 | +> * Currently, testing gRPC APIs isn't supported in the test console of the Azure portal or in the API Management developer portal. |
| 29 | +
|
| 30 | +[!INCLUDE [api-management-availability-premium-dev](../../includes/api-management-availability-premium-dev.md)] |
| 31 | + |
| 32 | +## Prerequisites |
| 33 | + |
| 34 | +* An API Management instance. If you don't already have one, complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md). |
| 35 | + |
| 36 | +* A gateway resource provisioned in your instance. If you don't already have one, see [Provision a self-hosted gateway in Azure API Management](api-management-howto-provision-self-hosted-gateway.md). |
| 37 | + |
| 38 | +* A gRPC Protobuff (.proto) file available locally and gRPC service that's accessible over HTTPS. |
| 39 | + |
| 40 | +## Add a gRPC API |
| 41 | + |
| 42 | +#### [Portal](#tab/portal) |
| 43 | + |
| 44 | +1. In the [Azure portal](https://portal.azure.com), navigate to your API Management instance. |
| 45 | + |
| 46 | +1. In the left menu, select **APIs** > **+ Add API**. |
| 47 | + |
| 48 | +1. Under **Define a new API**, select **gRPC**. |
| 49 | + |
| 50 | + :::image type="content" source="./media/grpc-api/grpc-api.png" alt-text="Screenshot of creating a gRPC API in the portal." ::: |
| 51 | + |
| 52 | +1. In the **Create a gRPC API window**, select **Full**. |
| 53 | + |
| 54 | +1. For a gRPC API, you must specify the following settings: |
| 55 | + |
| 56 | + 1. In **Upload schema**, select a local .proto file associated with the API to import. |
| 57 | + |
| 58 | + 1. In **gRPC server URL**, enter the address of the gRPC service. The address must be accessible over HTTPS. |
| 59 | + |
| 60 | + 1. In **Gateways**, select the gateway resource that you want to use to expose the API. |
| 61 | + |
| 62 | + > [!IMPORTANT] |
| 63 | + > In public preview, you can only select a self-hosted gateway. The **Managed** gateway isn't supported. |
| 64 | +
|
| 65 | +1. Enter remaining settings to configure your API. These settings are explained in the [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial. |
| 66 | + |
| 67 | +1. Select **Create**. |
| 68 | + |
| 69 | + The API is added to the **APIs** list. You can view update your settings by going to the **Settings** tab of the API. |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | + |
| 74 | +[!INCLUDE [api-management-append-apis.md](../../includes/api-management-append-apis.md)] |
| 75 | + |
| 76 | +[!INCLUDE [api-management-define-api-topics.md](../../includes/api-management-define-api-topics.md)] |
0 commit comments