Skip to content

Latest commit

 

History

History
83 lines (50 loc) · 3.82 KB

grpc-api.md

File metadata and controls

83 lines (50 loc) · 3.82 KB
title description services author ms.service ms.topic ms.date ms.author ms.custom
Import a gRPC API to Azure API Management
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.
api-management
dlepow
azure-api-management
how-to
05/06/2024
danlep
devx-track-arm-template, devx-track-bicep, build-2024, devx-track-dotnet

Import a gRPC API

[!INCLUDE api-management-availability-premium-dev]

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.

To add a gRPC API to API Management, you need to:

  • Upload the API's Protobuf (protocol buffer) definition file to API Management
  • Specify the location of your gRPC service
  • Configure the API in API Management

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.

Note

  • Currently, gRPC APIs are only supported in the self-hosted gateway, not the managed gateway for your API Management instance.
  • Currently, testing gRPC APIs isn't supported in the test console of the Azure portal or in the API Management developer portal.
  • Import is limited to a single Protobuff (.proto) file.

Prerequisites

Add a gRPC API

  1. In the Azure portal, navigate to your API Management instance.

  2. In the left menu, select APIs > + Add API.

  3. Under Define a new API, select gRPC.

    :::image type="content" source="./media/grpc-api/grpc-api.png" alt-text="Screenshot of creating a gRPC API in the portal." :::

  4. In the Create a gRPC API window, select Full.

  5. For a gRPC API, you must specify the following settings:

    1. In Upload schema, select a local .proto file associated with the API to import.

    2. In gRPC server URL, enter the address of the gRPC service. The address must be accessible over HTTPS.

    3. In Gateways, select the gateway resource that you want to use to expose the API.

      [!IMPORTANT] In public preview, you can only select a self-hosted gateway. The Managed gateway isn't supported.

  6. Enter remaining settings to configure your API. These settings are explained in the Import and publish your first API tutorial.

  7. Select Create.

    The API is added to the APIs list. You can view update your settings by going to the Settings tab of the API.


Call gRPC services with .NET

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

[!INCLUDE api-management-append-apis.md]

[!INCLUDE api-management-define-api-topics.md]