Azure function core tools throwing Grpc.Core.RpcException when attempting to run dotnet-isolated locally

137 Views Asked by At

I'm facing an issue when trying to run Azure Functions locally using the Azure Functions Core Tools on macOS Sonoma 1.4.12 with .NET 7 and .NET 8 isolated worker. What I'm trying to achieve is just testing an HTTP-triggered function locally, but shortly after starting the function with func start, it crashes with a Grpc.Core.RpcException.

Error Details:

The function starts correctly but then throws the following unhandled exception and crashes:

Unhandled exception. Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.", DebugException="System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while unable to establish HTTP/2 connection.")

Steps to Reproduce:

The error occurs by simply following the Microsoft guide for running C# Azure functions to create a project and a test HTTP-triggered function with the func tools:

  1. Create a new project with func init MyProjFolder --worker-runtime dotnet-isolated
  2. Add an HTTP trigger with func new --template "Http Trigger" --name MyHttpTrigger
  3. Navigate to MyProjFolder and start the function with func start

Environment Details:

Azure Function Core Tools version: 4
.NET versions: 7 and 8 (isolated)
OS: macOS Sonoma version 1.4.12
CPU architecture: x64

Attempts to Resolve:

I've tried reinstalling both the Azure Functions Core Tools and .NET frameworks without success. Interestingly, the same codebase executes flawlessly on a Windows 10 system and also when deployed directly to Azure. It's worth noting that I'm not explicitly using gRPC in my function, and this issue has only started occurring recently, suggesting it might be related to a recent update in the libraries or Mac OS setup.

Has anyone faced a similar issue or have any suggestions on how to resolve this gRPC connection error on macOS with dotnet-isolated for Azure Functions? Any insights or workarounds would be greatly appreciated.

0

There are 0 best solutions below