Azure function app error - Unhandled exception. Grpc.Core.RpcException

Madhu Rao 140 Reputation points
2025-07-02T04:57:37.4566667+00:00

I have an Azure function app hosting multiple functions.

The new function is failing to execute with the below error message.

Unhandled exception. Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error reading next message. IOException: The request was aborted. IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.. SocketException: An existing connection was forcibly closed by the remote host.", DebugException="System.IO.IOException: The request was aborted."), at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)

The rest of the functions are successfully executed.

Not sure what Grpc error means.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,940 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Krishna Chowdary Paricharla 805 Reputation points Microsoft External Staff Moderator
    2025-07-02T07:37:05.2533333+00:00

    Hello Madhu Rao,

    The error you're seeing (Grpc.Core.RpcException: StatusCode="Unavailable") indicates that the gRPC call from your new Azure Function failed due to a connection being forcibly closed by the remote host.

    This typically happens due to:

    • If the server is not running or the client is pointing to the wrong address/port, this error will occur.
    • gRPC requires HTTP/2. If the server is not configured for HTTP/2, connections will fail.
    • TLS/HTTP/2 incompatibility
    • Firewalls or network policies may block communication between the client and server.
    • Excessive open connections or sockets can exhaust system resources, causing this error.

    Since other functions are working, the issue is likely specific to the external service or configuration used in the new function.

    Ensure the target service is healthy and supports gRPC..

    • Ensure that the required ports (e.g., 50051) are open and accessible.
    • Configure your server to use HTTP/2.
    • Monitor system resources and limit concurrent connections. Use connection pooling where applicable.

    For your reference, please go through this following documentation:

    kindly consider clicking "Accept the answer" — this helps others in the community who might be looking for similar information. Appreciate your engagement! User's image

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.