gRPC is useful when applications need fast, strongly typed communication between services. It uses HTTP/2, supports streaming, and works well for internal service-to-service communication.
Azure Front Door is designed for global HTTP and HTTPS traffic routing, but gRPC introduces an important protocol requirement: HTTP/2 must be preserved between the client, the gateway, and the backend.
Azure Front Door Standard and Premium now have native gRPC support in public preview. For a gRPC-enabled route, HTTPS and HTTP/2 are required both from the client to Front Door and from Front Door to the origin. gRPC must also be enabled on the route and on every origin in the associated origin group.
This changes the architecture compared with traditional HTTP APIs. The important part is not simply adding a /grpc path. The entire connection path has to support the protocol correctly.
Understanding the gRPC Request Path
A typical architecture looks like this:
gRPC Client
|
| HTTPS + HTTP/2
v
Azure Front Door
|
| HTTPS + HTTP/2
v
Origin Group
|
v
ASP.NET Core gRPC Service
For normal HTTP applications, Front Door can terminate the client connection and communicate with an origin using HTTP/1.1. That model does not work for native gRPC because gRPC requires HTTP/2.
With the gRPC-enabled Front Door route, HTTP/2 is used on both connections. This is the important distinction when designing the route.
Why gRPC Routing Is Different
A normal ASP.NET Core API might expose endpoints such as:
/api/products
/api/orders
/api/customers
A gRPC service exposes RPC methods through HTTP/2. For example:
ProductService.GetProduct
ProductService.ListProducts
OrderService.CreateOrder
The HTTP request contains protocol-specific headers and framing that are handled by the gRPC stack.
A simplified gRPC request looks like:
POST /products.ProductService/GetProduct
Content-Type: application/grpc
TE: trailers
The request is not intended to be converted into an ordinary HTTP/1.1 request somewhere in the middle.
That is why protocol preservation is the central requirement when placing Front Door in front of a gRPC service.
Create a gRPC Service in ASP.NET Core
A simple ASP.NET Core gRPC service can be defined with a .proto file.
syntax = "proto3";
option csharp_namespace = "GrpcCatalog";
package catalog;
service CatalogService {
rpc GetProduct (GetProductRequest) returns (ProductReply);
}
message GetProductRequest {
int32 id = 1;
}
message ProductReply {
int32 id = 1;
string name = 2;
}
The generated C# types are then used by the server implementation.
public sealed class CatalogService : Catalog.CatalogBase
{
public override Task<ProductReply> GetProduct(
GetProductRequest request,
ServerCallContext context)
{
return Task.FromResult(new ProductReply
{
Id = request.Id,
Name = $"Product {request.Id}"
});
}
}
Register the gRPC services in the ASP.NET Core application:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGrpc();
var app = builder.Build();
app.MapGrpcService<CatalogService>();
app.Run();
The application should be configured to serve gRPC over HTTPS.
Configure HTTPS and HTTP/2
The backend must accept HTTP/2 because Front Door needs an HTTP/2 connection to the gRPC origin.
For Kestrel, the configuration can explicitly define an HTTP/2 endpoint:
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://0.0.0.0:5001",
"Protocols": "Http2"
}
}
}
}
For local development, the ASP.NET Core development certificate can be used.
For production, use a certificate trusted by the clients and correctly configured for the backend hostname.
The TLS configuration matters because Front Door validates the connection to the origin. The origin certificate and hostname configuration therefore need to match the way the origin is exposed.
Configure the Azure Front Door Origin
The next step is to add the gRPC service as an origin.
The origin should expose an HTTPS endpoint that supports HTTP/2.
Conceptually, the configuration looks like this:
Origin Group
|
+-- gRPC Origin
|
+-- https://grpc-api.example.com:443
If multiple gRPC services are deployed in different regions, they can be placed into the same origin group.
For example:
gRPC Client
|
v
Azure Front Door
|
+-------------------+
| |
v v
Region 1 Region 2
gRPC API gRPC API
Front Door can use its origin routing capabilities to distribute requests among configured origins.
Enable gRPC on the Front Door Route
The route is where the HTTP request is associated with the domain and origin group.
For a gRPC service, create a dedicated route for the gRPC traffic.
For example:
Domain:
api.example.com
Pattern:
/catalog/*
Origin Group:
catalog-grpc-origins
gRPC:
Enabled
The exact configuration should be checked against the current Azure Front Door portal or API because native gRPC support is currently in public preview and configuration details can evolve.
The critical configuration requirements are:
Client -> Front Door HTTPS + HTTP/2
Front Door -> Origin HTTPS + HTTP/2
Route gRPC enabled
Origin gRPC enabled
Origin Group gRPC-compatible origins
Microsoft's current documentation specifically states that gRPC must be enabled on the route and every origin in its origin group.
Use a Dedicated Route for gRPC
Keeping gRPC traffic separate from ordinary HTTP API traffic makes the configuration easier to understand and troubleshoot.
For example:
/api/*
-> REST API Origin Group
/catalog/*
-> gRPC Catalog Origin Group
/orders/*
-> gRPC Order Origin Group
This also prevents accidental configuration changes to ordinary HTTP routes from affecting gRPC traffic.
The route matching system evaluates the incoming request against the configured domain and path patterns before selecting the origin.
Configure the gRPC Client
A .NET gRPC client can connect to the Front Door hostname instead of directly connecting to the backend.
using Grpc.Net.Client;
using var channel = GrpcChannel.ForAddress(
"https://api.example.com");
var client = new CatalogService.CatalogServiceClient(channel);
var response = await client.GetProductAsync(
new GetProductRequest
{
Id = 10
});
Console.WriteLine(response.Name);
The client does not need to know which regional origin handled the request.
That is one of the main benefits of putting a global routing layer in front of the service.
Streaming Requires Extra Attention
gRPC supports four communication patterns:
Pattern | Description |
|---|
Unary | One request and one response |
Server streaming | One request followed by multiple responses |
Client streaming | Multiple client messages followed by one response |
Bidirectional streaming | Both sides continuously exchange messages |
For example, a streaming RPC can be defined as:
rpc WatchProducts (WatchRequest)
returns (stream ProductReply);
This is different from an ordinary REST request because the connection can remain active while messages are exchanged.
When testing gRPC through Front Door, test the actual communication pattern used by the application. A successful unary request does not automatically prove that long-lived streaming workloads behave correctly under every deployment and timeout configuration.
Health Checks Matter
The origin group needs healthy origins before Front Door can reliably route traffic to them.
A common mistake is to configure an HTTP health endpoint and assume that proves the gRPC service itself is healthy.
For example:
/health
might return:
200 OK
while the actual gRPC endpoint has a configuration problem.
A useful health strategy is to expose a lightweight health service appropriate for the gRPC application and verify that the backend configuration matches the protocol requirements.
The health check should be inexpensive and should not depend on a database or another slow external service unless that dependency is intentionally part of the service-health definition.
Secure the Origin
Putting Front Door in front of a gRPC service does not mean the origin should accept unrestricted traffic.
If the origin remains directly accessible, clients can potentially bypass the Front Door security and routing layer.
Microsoft recommends configuring origins so traffic cannot simply bypass Front Door's security features. Azure Front Door Premium also supports Private Link for supported origin scenarios.
A production architecture should therefore consider:
Internet
|
v
Azure Front Door
|
+-- WAF
|
+-- Routing
|
v
Protected gRPC Origin
The gRPC service should still perform its own authentication and authorization. Front Door should not become the only security boundary.
Authentication for gRPC
ASP.NET Core gRPC services can use authentication middleware just like other ASP.NET Core applications.
For example:
builder.Services.AddAuthentication("Bearer")
.AddJwtBearer("Bearer", options =>
{
options.Authority = "https://identity.example.com";
options.Audience = "catalog-api";
});
builder.Services.AddAuthorization();
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.MapGrpcService<CatalogService>();
app.Run();
The service should validate the token and enforce authorization based on the application's requirements.
This is especially important when the same Front Door endpoint exposes multiple services.
Common Configuration Problems
Front Door accepts the request but the gRPC call fails
Check whether gRPC is enabled on the route.
Also verify that every origin in the origin group has gRPC enabled.
The backend connection fails
Check the origin protocol and TLS configuration.
The gRPC connection from Front Door to the origin requires HTTPS and HTTP/2 when using the native gRPC capability.
The service works directly but not through Front Door
Compare the two paths:
Client -> gRPC Service
and:
Client -> Front Door -> gRPC Service
If the direct connection works, investigate Front Door route configuration, hostname configuration, origin health, TLS, and HTTP/2 settings.
REST endpoints work but gRPC does not
This is a useful diagnostic signal.
REST traffic can work through a normal HTTP configuration while gRPC fails because gRPC has stricter protocol requirements.
Do not assume that because /api/products works, /catalog.CatalogService/GetProduct will also work.
Common Mistakes
Enabling HTTP/2 only on the client side.
Forgetting to enable gRPC on the Front Door route.
Enabling gRPC on the route but not on every origin in the origin group.
Using an origin that does not correctly support HTTPS and HTTP/2.
Testing only unary RPCs when the application uses streaming.
Leaving the backend publicly accessible without considering Front Door bypass.
Treating a basic HTTP health endpoint as proof that the complete gRPC path is healthy.
Assuming HTTP/2 support automatically means gRPC support.
That last mistake is particularly important. Azure Front Door has long supported HTTP/2 for client connections, but gRPC requires HTTP/2 to remain available to the backend as well. Native gRPC support addresses this requirement for supported Standard and Premium configurations.
Best Practices
Keep the gRPC route separate from unrelated HTTP routes when practical.
Use HTTPS throughout the complete request path.
Configure every gRPC origin consistently.
Test unary and streaming RPCs separately.
Use authentication and authorization inside the gRPC application.
Monitor both Front Door and application-level failures.
Protect the origin from direct bypass where the architecture requires it.
Keep gRPC services small and focused rather than creating one service that contains unrelated application domains.
For production adoption, also verify the current preview limitations and supported scenarios before making the feature a critical dependency.
Advantages
Using Azure Front Door for supported gRPC scenarios can provide several architectural benefits:
Advantage | Description |
|---|
Global entry point | Clients can use a single public endpoint |
Origin routing | Traffic can be distributed across configured origins |
WAF integration | HTTP traffic can be protected at the edge |
TLS termination | Front Door can manage the client-side TLS boundary |
Centralized routing | gRPC services can be exposed through consistent routing rules |
Multi-region architecture | Multiple service deployments can be placed behind one entry point |
Disadvantages and Considerations
There are also reasons to evaluate the architecture carefully.
Consideration | Impact |
|---|
Preview status | Native gRPC support is still subject to preview limitations |
Protocol sensitivity | HTTP/2 must work across the complete path |
Streaming behavior | Long-running streams require additional testing |
Configuration complexity | Route and origin settings must remain consistent |
Troubleshooting | Failures can occur at multiple layers |
Backend protection | Direct origin access needs to be controlled |
For critical production workloads, do not select the architecture solely because the route appears to work in a basic test. Validate the exact RPC patterns, authentication model, streaming behavior, failure handling, and operational requirements of the application.
Troubleshooting Checklist
When a gRPC request fails through Azure Front Door, check the following order:
Confirm the client is connecting over HTTPS.
Confirm the Front Door route has gRPC enabled.
Confirm every origin in the selected origin group has gRPC enabled.
Confirm the origin supports HTTPS and HTTP/2.
Verify the origin certificate and hostname configuration.
Check the origin health status.
Test the same RPC directly against the backend.
Test the RPC through Front Door.
Check Front Door logs and application logs.
Test streaming separately if the application uses streaming RPCs.
This approach helps identify whether the problem is in the client, Front Door configuration, TLS, routing, or the gRPC application itself.
Summary
Adding gRPC routing through Azure Front Door requires more than creating a path-based route. The protocol must be supported across the complete connection path.
For native gRPC support in Azure Front Door Standard and Premium, HTTPS and HTTP/2 are required from the client to Front Door and from Front Door to the origin. gRPC also needs to be enabled on the route and on the origins in the selected origin group.
The practical architecture is straightforward:
gRPC Client
|
HTTPS + HTTP/2
|
v
Azure Front Door
|
HTTPS + HTTP/2
|
v
gRPC Origin
|
v
ASP.NET Core gRPC Service
The important work is making sure every layer agrees on the protocol, TLS configuration, routing, authentication, health checks, and streaming behavior.
Because the native gRPC capability is currently in public preview, teams should also validate the current Azure limitations and supported scenarios before depending on it for a critical production workload.
Join the conversation! Your thoughts help the community grow.