René Heuven
René Heuven

Reputation: 337

Deploy gRPC service to Azure Linux App Service - port not open

I created a gRPC service using C#. Locally this service works. For HTTP/2 I used port 8585. I have also gRPC-Web implemented, so all methods can be called using HTTP REST API requests as well as via gRPC calls.

Now when deployed to a Linux App Service on Azure, I can open https://xxx.azurewebsites.net/version via the web browser and I receive the version number in JSON.

But trying this from Windows PowerShell: .\grpcurl xxx.azurewebsites.net:8585 bonviewapi.BonView/Version gives: Failed to dial target host "xxx.azurewebsites.net:8585": context deadline exceeded

I followed these instructions to deploy the gRPC service: https://github.com/Azure/app-service-linux-docs/blob/master/HowTo/gRPC/use_gRPC_with_dotnet.md

But nmap shows port 8585 is not open:

nmap -p 8585 xxx.azurewebsites.net

PORT STATE SERVICE 8585/tcp filtered unknown

In Azure portal if I look at "Log Streams", I see:

2022-05-27T14:54:03.092Z INFO - docker run -d -p 8080:8080 --name bonviewapi_6_4697c7ec -e WEBSITE_SITE_NAME=bonviewapi -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=bonviewapi.azurewebsites.net -e WEBSITE_INSTANCE_ID=075e97bea78adeb84472f3759e2f2bed6e7ee50a77bbe5ffb3096255854fdab0 -e HTTP_LOGGING_ENABLED=1 appsvc/dotnetcore:lts_20211110.1

Also see:

2022-05-27T22:42:11.764179274Z [40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[14] 2022-05-27T22:42:11.764246376Z Now listening on: http://[::]:8080 2022-05-27T22:42:11.772259840Z [40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[14] 2022-05-27T22:42:11.772301442Z Now listening on: http://[::]:8585 2022-05-27T22:42:11.772311542Z [40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0] 2022-05-27T22:42:11.772319542Z Application started. Press Ctrl+C to shut down. 2022-05-27T22:42:11.772343943Z [40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0] 2022-05-27T22:42:11.772352243Z Hosting environment: Development 2022-05-27T22:42:11.772375144Z [40m[32minfo[39m[22m[49m: Microsoft.Hosting.Lifetime[0] 2022-05-27T22:42:11.772383644Z Content root path: /home/site/wwwroot

How can I trouble shoot this problem. Did I overlook something? How to open port 8585 for the Azure Linux App Service?

Best regards, Rene

Upvotes: 0

Views: 904

Answers (1)

René Heuven
René Heuven

Reputation: 337

One needs to read carefully ;).

https://github.com/Azure/app-service-linux-docs/blob/master/HowTo/gRPC/use_gRPC_with_dotnet.md states:

"The following documentation is dependent on a future release of App Service that is not currently available to the public. gRPC is currently available to try in EUAP with Private Preview".

Here is an excellent post on LinkedIn explaining the differences between GA (Generally Available), Public Preview and Private Preview:

https://www.linkedin.com/pulse/differences-between-ga-private-public-preview-azure-radu-vunvulea/?trk=articles_directory

So to deploy gRPC services onto a Azure App Service is currently not possible, only people invited by the Product Team can try out the Private Preview.

As a workaround I will implement gRPC-Web as well such that I can deploy on Azure, but then will be using HTTP REST API calls implemented through gRPC (well, yes, most of the gRPC benefits are then void). Hopefully gRPC support for App Service makes it quickly to Public Review and/or GA.

Otherwise I still have the option to host gRPC in IIS or by installing Kestrel on a Linux VM which definitely should already be possible today.

Upvotes: 0

Related Questions