Can't start the default Azure Function in Visual Studio 2022

Owen Chen 0 Reputation points
2025-07-02T04:32:17.5366667+00:00

Visual Studio 2022 17.14.7

Core Tools Version: 4.0.7317 Commit hash: N/A +5ca56d37938824531b691f094d0a77fd6f51af20 (64-bit)

Function Runtime Version: 4.1038.300.25164

Following the quick start (https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio) to create a new Azure Function in Visual Studio 2022.

I got the following error when I hit F5 to start the function:

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.")'

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Surya Amrutha Vaishnavi Lanka (INFOSYS LIMITED) 245 Reputation points Microsoft External Staff
    2025-07-30T06:07:43.92+00:00

    Simple Steps

    1. Close Visual Studio
    2. Open Environment Variables

    Search: Edit the system environment variables → click it 

    Click Environment Variables

    1. Add a New System Variable

    Click New under “System variables”

    Name: DOTNET_SYSTEM_NET_HTTP_SOCKETSHTTPHANDLER_HTTP2SUPPORT

    Value: 0

    Click OK

    1. Restart Your PC
    2. Open Visual Studio Again

    Open your Azure Function project

    Press F5 to run


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.