Skip to content
English
  • There are no suggestions because the search field is empty.

[Public] Fixing gRPC Connection Errors with IronPDF in Azure Containers (.NET Framework and .NET Core)

Are you deploying IronPDF in a Docker container or Azure Container Instance and seeing mysterious gRPC connection errors?

Errors like:

Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="failed to connect to all addresses")

 

Or:

 
Status(StatusCode="Unknown", Detail="Stream removed")

 

can interrupt your PDF generation flow — especially after periods of inactivity or when dealing with long-running operations.

This guide explains how to fix these issues across .NET Framework and .NET Core+ using the correct gRPC setup with retry logic and connection configuration.


Why This Happens

These issues are typically caused by:

  • Containers going idle (e.g., in ACI or App Service)

  • Lack of retry configuration in the gRPC client

  • Premature stream closure (HTTP/2 behavior)

  • Improper connection setup for your platform (.NET Framework vs. Core)


 How to Fix It

✅ 1. Prevent Container Idle Shutdown

In Azure Container Instances (ACI) or Azure App Service:

  • Use a dedicated plan, not consumption-based

  • Ensure restart policy is set to Always

  • Consider Azure Kubernetes Service (AKS) for long-lived containers

✅ 2. Use the Correct gRPC Channel for Your .NET Version

 

🔷 .NET Framework: Use Grpc.Core.Channel with Retry Logic

 

.NET Framework does not support GrpcChannel.ForAddress() from Grpc.Net.Client. You must use Grpc.Core.Channel, and manually inject retry configuration via grpc.service_config.

Screenshot 2025-06-06 114614
 
 
🔶 .NET Core / .NET 5+: Use Grpc.Net.Client.GrpcChannel with Retry Policy
 
 

Screenshot 2025-06-06 115233

 

✅ 3. Use .RemoteServer(...) for Simpler Configuration

In many cases, especially with cloud deployments, this is all you need:

IronPdf.Installation.ConnectToIronPdfHost(
IronPdfConnectionConfiguration.RemoteServer("http://your-container-host:33350")
);

 

Avoid using .Docker() unless the IronPDF engine and your app share the same local Docker network.

 

✅ 4. Prevent Auto-Shutdown Between Calls

 

Set this flag to keep the engine alive between requests:

IronPdf.Installation.SkipShutdown = true;

 

 

🔁 Summary: Recommended gRPC Setup by Platform

Runtime Recommended Channel API Retry Support Notes
.NET Framework Grpc.Core.Channel(...) ✅ (via JSON config) Use WithCustomChannel()
.NET Core / 5+ Grpc.Net.Client.GrpcChannel.ForAddress(...) ✅ (via ServiceConfig) Use WithCustomChannel()
Any RemoteServer(...) ✅ (basic retry) Simplest setup
 
 

🧪 Debug Tips

  • Set these env vars in your Dockerfile to enable gRPC logs:

ENV GRPC_TRACE=all
ENV GRPC_VERBOSITY=DEBUG
  • Monitor logs:

    • cef.log: Chromium (PDF engine) internals

    • IronSoftware.log: IronPDF lifecycle and rendering info


Final Thoughts

Running IronPDF in Docker or ACI is powerful — but only when gRPC is configured correctly for your .NET runtime. Whether you're using .NET Framework or Core, the right setup ensures reliability, especially in production.

If you're seeing random gRPC exceptions, implement retries and use the correct connection method for your environment.