question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GRPC .net 7 and Azure app service not working

See original GitHub issue

In this video for .Net 7 and GRPC https://www.youtube.com/watch?v=et_2NBk4N4Y the say that GRPC should work on azure linux app service.

I have implemented following this guide with no success. https://github.com/Azure/app-service-linux-docs/blob/master/HowTo/gRPC/use_gRPC_with_dotnet.md

this is my program.cs

var builder = WebApplication.CreateBuilder(args);
    
    builder.WebHost.ConfigureKestrel(options =>
    {
    options.ListenAnyIP(8080);
    options.ListenAnyIP(5253, listenOptions =>
    {
        listenOptions.Protocols =   Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;
    });
    });
   
    // Add services to the container.
    builder.Services.AddGrpc();
    builder.Services.AddGrpcReflection();

    var app = builder.Build();

    // Configure the HTTP request pipeline.
    app.MapGrpcService<MobileAppsService>();
    app.MapGrpcReflectionService();
    app.MapGet("/", () => "Communication with gRPC endpoints must be made through a    gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909");

app.Run();

Test with Postman and only get Error: Received RST_STREAM with code 0

If a test local in postman all works.

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jeffwmartinezcommented, Dec 14, 2022

I’ve added an updated document that explains how to use .NET 7 with App Service. A sample server app is included here https://github.com/Azure/app-service-linux-docs/tree/master/HowTo/gRPC/.NET/.NET%207

0reactions
czmirekcommented, May 15, 2023

Hello all, I also had problem problem with deploying gRPC on Linux Azure WebApp but found a solution to this some time ago.

You need to remove the following lines for the project to run in NET 7. They are required in .NET 6 but in .NET 7 they’ll cause your app to crash. I’ve already discovered this here: https://stackoverflow.com/questions/65671652/can-you-use-grpc-grpc-web-to-communicate-between-microservices-hosted-on-azure/73456768#73456768

    options.ListenAnyIP(8080);
    options.ListenAnyIP(5253, listenOptions =>
    {
        listenOptions.Protocols =   Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http2;
    });
    });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to connect to .NET 7 GRPC service on running on ...
I have a GRPC service written in .NET 7. It works without issue locally. To publish it to an app service, I followed...
Read more >
Should GRPC net and Azure app service work
In this video for .Net 7 and GRPC https://www.youtube.com/watch?v=et_2NBk4N4Y the say that GRPC should work on azure linux app service.
Read more >
gRPC support on Azure App Service
We are pleased to announce that gRPC is coming to Azure App Service for Linux workloads. Using gRPC, you can utilize the remote...
Read more >
Deploying a .NET gRPC Server on Azure App Service
In this article we are going to be deploying a gRPC web service written in .NET to an Azure App Service. We will...
Read more >
Secure ASP.NET Core GRPC API hosted in a Linux kestrel ...
This article shows how to implement a secure GRPC API service implemented in ASP.NET Core and hosted on an Azure App Service using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found