Closed JoacimWall closed 4 months ago
I think this is gRPC dotnet (https://github.com/grpc/grpc-dotnet) not this legacy C# gRPC library. You may want to ask the question here: https://github.com/grpc/grpc-dotnet/issues
Unfortunately the client error doesn't provide much information. What do the server logs say?
Log files in zip file below.
Zip Deployment succeeded. ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Elapsed 00:23,006 ========== ========== Publish: 1 succeeded, 0 failed, 0 skipped ========== ========== Elapsed 00:23,006 ========== A call to warmup your site failed with response code: 'ServiceUnavailable'.
2022-11-24T07:17:08 Welcome, you are now connected to log-streaming service. Starting Log Tail -n 10 of existing logs ---- /home/LogFiles/lastCheckTime.txt (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/lastCheckTime.txt)11/24/2022 07:09:07
/home/LogFiles/kudu/trace/29a9553eb757-e0ccc7e0-5f55-405a-bd22-36781f44fca2.txt (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/29a9553eb757-e0ccc7e0-5f55-405a-bd22-36781f44fca2.txt) 2022-11-16T15:33:51 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 70,1,5, ScmType: None
/home/LogFiles/kudu/trace/474a3a86d594-1bd6e6d6-7af3-4f32-8be5-d7dfc4cd2dd9.txt (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/474a3a86d594-1bd6e6d6-7af3-4f32-8be5-d7dfc4cd2dd9.txt) 2022-11-24T07:08:39 Startup Request, url: /diagnostics/runtime, method: GET, type: request, pid: 70,1,77, ScmType: None
/home/LogFiles/kudu/trace/52782e15d47f-ed404854-a9f7-4b81-8dbc-8eaaf15e88d5.txt (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/52782e15d47f-ed404854-a9f7-4b81-8dbc-8eaaf15e88d5.txt) 2022-11-16T15:59:20 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 68,1,26, ScmType: None
/home/LogFiles/kudu/trace/b7be5d4f76d5-955689c9-e1b9-48a6-8416-fcdca0900d41.txt (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/b7be5d4f76d5-955689c9-e1b9-48a6-8416-fcdca0900d41.txt) 2022-11-16T17:05:07 Startup Request, url: /api/zipdeploy?isAsync=true, method: POST, type: request, pid: 67,1,29, ScmType: None
/home/LogFiles/kudu/trace/cc96e1530e9a-ee136fcc-3d37-4b5c-afef-f4ae449fe444.txt (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/kudu/trace/cc96e1530e9a-ee136fcc-3d37-4b5c-afef-f4ae449fe444.txt) 2022-11-16T14:54:20 Startup Request, url: /diagnostics/runtime, method: GET, type: request, pid: 70,1,4, ScmType: None
/home/LogFiles/2022_11_16_lw1sdlwk0000OD_default_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_16_lw1sdlwk0000OD_default_docker.log)
2022-11-16T17:08:56.179842700Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
2022-11-16T17:08:56.179846600Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
2022-11-16T17:08:56.179850400Z at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
2022-11-16T17:08:56.179854300Z at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
2022-11-16T17:08:56.179858000Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2022-11-16T17:08:56.179862000Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2022-11-16T17:08:56.179865700Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
2022-11-16T17:08:56.187382381Z at Program.
/home/LogFiles/2022_11_16_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_16_lw1sdlwk0000OD_docker.log) 2022-11-16T17:08:46.329Z INFO - docker run -d --expose=8080 --expose=5253 --name fmsynclinuxqa_0_af32cf9e -e WEBSITE_SITE_NAME=fmsynclinuxqa -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=fmsynclinuxqa.azurewebsites.net -e WEBSITE_INSTANCE_ID=3f69e3bb6c6a203df93077268c958bef35fe899e34874c197b577a81a708c3f2 -e WEBSITE_USE_DIAGNOSTIC_SERVER=True appsvc/dotnetcore:7.0_20221108.10.tuxprod dotnet TemplateServer.dll 2022-11-16T17:08:46.330Z INFO - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2022-11-16T17:08:49.225Z INFO - Initiating warmup request to container fmsynclinuxqa_0_af32cf9e_msiProxy for site fmsynclinuxqa 2022-11-16T17:08:49.310Z INFO - Container fmsynclinuxqa_0_af32cf9e_msiProxy for site fmsynclinuxqa initialized successfully and is ready to serve requests. 2022-11-16T17:08:49.321Z INFO - Initiating warmup request to container fmsynclinuxqa_0_af32cf9e for site fmsynclinuxqa 2022-11-16T17:08:58.421Z ERROR - Container fmsynclinuxqa_0_af32cf9e for site fmsynclinuxqa has exited, failing site start 2022-11-16T17:08:58.484Z ERROR - Container fmsynclinuxqa_0_af32cf9e didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging. 2022-11-16T17:08:58.570Z INFO - Stopping site fmsynclinuxqa because it failed during startup.
/home/LogFiles/2022_11_17_lw1sdlwk0000OD_default_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_17_lw1sdlwk0000OD_default_docker.log)
2022-11-17T09:43:18.545583863Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
2022-11-17T09:43:18.545587663Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
2022-11-17T09:43:18.545591363Z at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
2022-11-17T09:43:18.545595063Z at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
2022-11-17T09:43:18.545599263Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2022-11-17T09:43:18.545603063Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2022-11-17T09:43:18.545606663Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
2022-11-17T09:43:18.554202735Z at Program.
/home/LogFiles/2022_11_17_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_17_lw1sdlwk0000OD_docker.log) 2022-11-17T09:43:08.896Z INFO - docker run -d --expose=8080 --expose=5253 --name fmsynclinuxqa_0_5dc9873e -e WEBSITE_SITE_NAME=fmsynclinuxqa -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=fmsynclinuxqa.azurewebsites.net -e WEBSITE_INSTANCE_ID=3f69e3bb6c6a203df93077268c958bef35fe899e34874c197b577a81a708c3f2 -e WEBSITE_USE_DIAGNOSTIC_SERVER=True appsvc/dotnetcore:7.0_20221108.10.tuxprod dotnet TemplateServer.dll 2022-11-17T09:43:08.897Z INFO - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2022-11-17T09:43:11.893Z INFO - Initiating warmup request to container fmsynclinuxqa_0_5dc9873e_msiProxy for site fmsynclinuxqa 2022-11-17T09:43:11.958Z INFO - Container fmsynclinuxqa_0_5dc9873e_msiProxy for site fmsynclinuxqa initialized successfully and is ready to serve requests. 2022-11-17T09:43:11.965Z INFO - Initiating warmup request to container fmsynclinuxqa_0_5dc9873e for site fmsynclinuxqa 2022-11-17T09:43:20.975Z ERROR - Container fmsynclinuxqa_0_5dc9873e for site fmsynclinuxqa has exited, failing site start 2022-11-17T09:43:21.124Z ERROR - Container fmsynclinuxqa_0_5dc9873e didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging. 2022-11-17T09:43:21.448Z INFO - Stopping site fmsynclinuxqa because it failed during startup.
/home/LogFiles/2022_11_18_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_18_lw1sdlwk0000OD_docker.log) 2022-11-18T00:21:14.198Z INFO -
/home/LogFiles/2022_11_19_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_19_lw1sdlwk0000OD_docker.log) 2022-11-19T00:21:14.198Z INFO -
/home/LogFiles/2022_11_20_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_20_lw1sdlwk0000OD_docker.log) 2022-11-20T00:21:14.201Z INFO -
/home/LogFiles/2022_11_21_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_21_lw1sdlwk0000OD_docker.log) 2022-11-21T00:21:14.197Z INFO -
/home/LogFiles/2022_11_22_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_22_lw1sdlwk0000OD_docker.log) 2022-11-22T00:21:14.198Z INFO -
/home/LogFiles/2022_11_23_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_23_lw1sdlwk0000OD_docker.log) 2022-11-23T00:21:14.196Z INFO -
/home/LogFiles/2022_11_24_lw1sdlwk0000OD_default_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_24_lw1sdlwk0000OD_default_docker.log)
2022-11-24T07:09:26.831351831Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.BindAsync(CancellationToken cancellationToken)
2022-11-24T07:09:26.831355531Z at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
2022-11-24T07:09:26.831359231Z at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
2022-11-24T07:09:26.831362831Z at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
2022-11-24T07:09:26.831366531Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2022-11-24T07:09:26.831370231Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2022-11-24T07:09:26.831373731Z at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
2022-11-24T07:09:26.831384131Z at Program.
/home/LogFiles/2022_11_24_lw1sdlwk0000OD_docker.log (https://fmsynclinuxqa.scm.azurewebsites.net/api/vfs/LogFiles/2022_11_24_lw1sdlwk0000OD_docker.log) 2022-11-24T07:09:17.922Z INFO - docker run -d --expose=8080 --expose=5253 --name fmsynclinuxqa_0_4d5f8a95 -e WEBSITE_SITE_NAME=fmsynclinuxqa -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=fmsynclinuxqa.azurewebsites.net -e WEBSITE_INSTANCE_ID=3f69e3bb6c6a203df93077268c958bef35fe899e34874c197b577a81a708c3f2 -e WEBSITE_USE_DIAGNOSTIC_SERVER=True appsvc/dotnetcore:7.0_20221108.10.tuxprod dotnet TemplateServer.dll 2022-11-24T07:09:17.924Z INFO - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2022-11-24T07:09:20.502Z INFO - Initiating warmup request to container fmsynclinuxqa_0_4d5f8a95_msiProxy for site fmsynclinuxqa 2022-11-24T07:09:20.623Z INFO - Container fmsynclinuxqa_0_4d5f8a95_msiProxy for site fmsynclinuxqa initialized successfully and is ready to serve requests. 2022-11-24T07:09:20.626Z INFO - Initiating warmup request to container fmsynclinuxqa_0_4d5f8a95 for site fmsynclinuxqa 2022-11-24T07:09:29.061Z ERROR - Container fmsynclinuxqa_0_4d5f8a95 for site fmsynclinuxqa has exited, failing site start 2022-11-24T07:09:29.142Z ERROR - Container fmsynclinuxqa_0_4d5f8a95 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging. 2022-11-24T07:09:30.408Z INFO - Stopping site fmsynclinuxqa because it failed during startup.
Ending Log Tail of existing logs --- Starting Live Log Stream --- 2022-11-24T07:18:08 No new trace in the past 1 min(s). zip.zip
It looks like this is the important bit:
Container fmsynclinuxqa_0_4d5f8a95 didn't respond to HTTP pings on port: 8080, failing site start.
For some reason, your website isn't responding to HTTP/1.1 requests on port 8080.
It looks like this is the important bit:
Container fmsynclinuxqa_0_4d5f8a95 didn't respond to HTTP pings on port: 8080, failing site start.
For some reason, your website isn't responding to HTTP/1.1 requests on port 8080. Hi Thanks. It would be nice if you could answer whether the current version of grpc and net 7 should work on Azure App Service. And if so please provide a link to guide or documentation stating how to configure it if that exists.
Is the this the link that I should follow? https://github.com/Azure/app-service-linux-docs/blob/master/HowTo/gRPC/use_gRPC_with_dotnet.md
Thanks Joachim
I believe so. I haven't heard of other documentation.
cc @jeffwmartinez
There is a problem with the current docs. Here's the issue for fixing them: https://github.com/Azure/app-service-linux-docs/issues/149
Thanks for your help.
now got it working with net 6.0. There were two mistakes I made:
So now I'm going to test if I can make it work with net. 7.0 and with MAUI IOS and Android clients.
//Joacim
Triage: We're working to improve the docs.
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
@jeffwmartinez A lot of places link to https://github.com/Azure/app-service-linux-docs/blob/master/HowTo/gRPC/use_gRPC_with_dotnet.md. Could it be updated to point to fixed documentation?
Is anyone else having issues connecting once the app is deployed? I've went through the .net 7 instructions a few times, but always hit the same issue. It says it's working. I get the "endpoints must be made through a gRPC client" message if I try to connect with a browser, but connection times out when trying to connect with a test app. I've verified the http2 config settings in the general and app settings tab. Here's the log from the app. It just doesn't even seem to see the requests.
2023-01-29T18:17:01.733963845Z ASP .NETCore Version: 7.0.1 2023-01-29T18:17:01.733967245Z Note: Any data outside '/home' is not persisted 2023-01-29T18:17:03.241488233Z Starting OpenBSD Secure Shell server: sshd. 2023-01-29T18:17:04.014288487Z Starting periodic command scheduler: cron. 2023-01-29T18:17:04.014985390Z Running oryx create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -defaultAppFilePath /defaulthome/hostingstart/hostingstart.dll -bindPort 8080 -bindPort2 '8585' -userStartupCommand 'dotnet xxxx.GPRC.dll' 2023-01-29T18:17:04.050062623Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml' 2023-01-29T18:17:04.050213924Z Could not find operation ID in manifest. Generating an operation id... 2023-01-29T18:17:04.065860784Z Build Operation ID: cdd5d762-16a5-472f-95d6-66f214b4ff3d 2023-01-29T18:17:04.404195874Z 2023-01-29T18:17:04.412895908Z Agent extension 2023-01-29T18:17:04.412916008Z Before if loop >> DotNet Runtime 2023-01-29T18:17:04.548230524Z DotNet Runtime 7.0Writing output script to '/opt/startup/startup.sh' 2023-01-29T18:17:04.659425648Z Running user provided startup command... 2023-01-29T18:17:06.958777305Z warn: Microsoft.AspNetCore.Server.Kestrel[0] 2023-01-29T18:17:06.958826705Z Overriding address(es) 'http://*:8080'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead. 2023-01-29T18:17:07.090840333Z info: Microsoft.Hosting.Lifetime[14] 2023-01-29T18:17:07.090875033Z Now listening on: http://[::]:8080 2023-01-29T18:17:07.090881133Z info: Microsoft.Hosting.Lifetime[14] 2023-01-29T18:17:07.090885633Z Now listening on: http://[::]:8585 2023-01-29T18:17:07.090889833Z info: Microsoft.Hosting.Lifetime[0] 2023-01-29T18:17:07.090894133Z Application started. Press Ctrl+C to shut down. 2023-01-29T18:17:07.090898433Z info: Microsoft.Hosting.Lifetime[0] 2023-01-29T18:17:07.090902633Z Hosting environment: Production 2023-01-29T18:17:07.090907033Z info: Microsoft.Hosting.Lifetime[0] 2023-01-29T18:17:07.090911033Z Content root path: /home/site/wwwroot
Thanks for any advice!
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;
});
});
I am currently using .Net 8 and have completed nearly all the necessary configurations for deploying it on the Azure app service (Linux). While all gRPC requests function correctly in my local environment, I encounter a 502 error when making the same requests to my deployed code. Thus, after I included this in the App settings, gRPC requests began functioning properly.
Sounds like a config issue. It does require SSL if it's not local. If that's not it run through the deployment tutorial again. It's very picky.
On May 3, 2024 8:01 AM, Muhammad Qasim @.***> wrote:
I am currently using .Net 8 and have completed nearly all the necessary configurations for deploying it on the Azure app service (Linux). While all gRPC requests function correctly in my local environment, I encounter a 502 error when making the same requests to my deployed code. image.png (view on web)https://github.com/grpc/grpc-dotnet/assets/12516813/7c58b806-47a1-4cc9-b2f5-ec5a8370c905 Thus, after I included this in the App settings, gRPC requests began functioning properly.
— Reply to this email directly, view it on GitHubhttps://github.com/grpc/grpc-dotnet/issues/1954#issuecomment-2092870413, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGZ7ZKAPNUS7ICE6H3GWKXLZAN4C3AVCNFSM6AAAAAASGXNF2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJSHA3TANBRGM. You are receiving this because you commented.Message ID: @.***>
From now on, please discuss gRPC + Azure issues in Azure forums. Those are the best places to get help related to Azure.
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
Test with Postman and only get Error: Received RST_STREAM with code 0
If a test local in postman all works.