Import a gRPC API
APPLIES TO: Developer | Premium
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
An API Management instance. If you don't already have one, complete the following quickstart: Create an Azure API Management instance.
A gateway resource provisioned in your instance. If you don't already have one, see Provision a self-hosted gateway in Azure API Management.
A gRPC Protobuff (.proto) file available locally and gRPC service that's accessible over HTTPS.
Add a gRPC API
In the Azure portal, navigate to your API Management instance.
In the left menu, select APIs > + Add API.
Under Define a new API, select gRPC.
In the Create a gRPC API window, select Full.
For a gRPC API, you must specify the following settings:
In Upload schema, select a local .proto file associated with the API to import.
In gRPC server URL, enter the address of the gRPC service. The address must be accessible over HTTPS.
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.
Enter remaining settings to configure your API. These settings are explained in the Import and publish your first API tutorial.
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:
Append other APIs
You can compose an API of APIs exposed by different services, including:
- An OpenAPI specification
- A SOAP API
- A GraphQL API
- A Web App hosted in Azure App Service
- Azure Function App
- Azure Logic Apps
- Azure Service Fabric
Append a different API to your existing API using the following steps.
Note
When you import another API, the operations are appended to your current API.
Go to your Azure API Management instance in the Azure portal.
Select APIs on the Overview page or from the menu on the left.
Click ... next to the API that you want to append another API to.
Select Import from the drop-down menu.
Select a service from which to import an API.
Related topics
- API import limitations
- Import an OpenAPI specification
- Import a SOAP API
- Import a SOAP API and convert to REST
- Import an App Service API
- Import a Container App API
- Import a WebSocket API
- Import a GraphQL API
- Import a GraphQL schema and set up field resolvers
- Import an Azure Function App
- Import an Azure Logic App
- Import a Service Fabric service
- Import an Azure OpenAI API
- Import an OData API
- Import SAP OData metadata
- Import a gRPC API
- Edit an API