Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host grpc service in iis or as an app service? #9020

Open
moodya opened this issue Apr 3, 2019 · 152 comments
Open

Host grpc service in iis or as an app service? #9020

moodya opened this issue Apr 3, 2019 · 152 comments
Labels
Milestone

Comments

@moodya
Copy link

@moodya moodya commented Apr 3, 2019

Is it possible to do this? If so how?


2020/06/17 Update - @JamesNK

User voice issue

There is a Microsoft Azure user voice issue for adding gRPC support to App Service. Consider voting if this is an important feature for you.

gRPC-Web

gRPC-Web with .NET is now available. gRPC-Web is compatible with IIS and Azure App Service. Link to blog post with more info: https://devblogs.microsoft.com/aspnet/grpc-web-for-net-now-available/

@moodya moodya changed the title Host grpc service in iis? Host grpc service in iis or as an app service? Apr 3, 2019
@Eilon Eilon added the area-grpc label Apr 3, 2019
@Eilon
Copy link
Member

@Eilon Eilon commented Apr 3, 2019

Hi @moodya , have you checked out the docs at https://docs.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.0&tabs=visual-studio ?

If you're running into a problem, please let us know and we can investigate.

@Eilon Eilon added the question label Apr 3, 2019
@moodya
Copy link
Author

@moodya moodya commented Apr 3, 2019

@moodya
Copy link
Author

@moodya moodya commented Apr 3, 2019

@Eilon
Copy link
Member

@Eilon Eilon commented Apr 3, 2019

@shirhatti - any idea on this?

@shirhatti
Copy link
Member

@shirhatti shirhatti commented Apr 3, 2019

Can't host gRPC in IIS/Azure App Service.
The HTTP/2 implementation of Http.Sys does not support HTTP response trailing headers which gRPC relies on.

@JamesNK JamesNK added this to the Discussions milestone Apr 3, 2019
@moodya
Copy link
Author

@moodya moodya commented Apr 4, 2019

@shirhatti
Copy link
Member

@shirhatti shirhatti commented Apr 8, 2019

The recommended approach is to host your gRPC service on AKS.

As far as App Service timelines go, I'd defer to @stefsch

@moodya
Copy link
Author

@moodya moodya commented Apr 8, 2019

@alustrement
Copy link

@alustrement alustrement commented Apr 25, 2019

I'm currently expecting issues to do this. I got a gRPC service running well using aspnetcore 3 preview 3 and Kestrel. But, an error about trailers appears using IIS when the service send the response (the request is well received) :
gPRC error => 2 UNKNOWN: No status received)
Dotnet error => "Trailers are not supported for this response" in Microsoft.AspNetCore.Http.ResponseTrailerExtensions.AppendTrailer(HttpResponse response, String trailerName, StringValues trailerValues) at Grpc.AspNetCore.Server.Internal.HttpResponseExtensions.ConsolidateTrailers...

@moodya
Copy link
Author

@moodya moodya commented Apr 25, 2019

@alustrement
Copy link

@alustrement alustrement commented Apr 25, 2019

Following this exchange https://forums.iis.net/p/1241598/2147837.aspx?p=True&t=636917571046786374, it seems that is not the responsibilty of the web server to handle gRPC. gPRC use HTTP/2, IIS supports HTTP/2, so it must works. If it's not, it's a bug from IIS or, more possible, from dotnetcore.

@moodya
Copy link
Author

@moodya moodya commented Apr 25, 2019

@alustrement
Copy link

@alustrement alustrement commented Apr 25, 2019

Thanks, I missed it and it makes sense with my issue.
@shirhatti the support is planned on the roadmap ?

@shirhatti
Copy link
Member

@shirhatti shirhatti commented Apr 25, 2019

We (IIS) are currently evaluating whether to support HTTP response trailers. No roadmaps/commitments I can speak to yet.

@jbrantly
Copy link

@jbrantly jbrantly commented Apr 25, 2019

@shirhatti Given gRPC seems to be a major feature of .NET Core 3 (https://github.com/grpc/grpc-dotnet), it would be a real shame if it's not hostable in IIS/App Service given so many .NET web applications are hosted on those. I hope the availability of that feature in .NET Core helps drive your roadmap.

@Misiu
Copy link

@Misiu Misiu commented Apr 26, 2019

I fully agree with @jbrantly. gRPC is advertised as one of the main features of .NET Core 3.
It should be hostable in IIS/Azure App Services.
@shirhatti please consider adding this to the roadmap

@moodya
Copy link
Author

@moodya moodya commented Apr 26, 2019

@aloisdeniel
Copy link

@aloisdeniel aloisdeniel commented Apr 26, 2019

I couldn't agree more.

@davidfowl
Copy link
Contributor

@davidfowl davidfowl commented Apr 26, 2019

We're looking into it. It requires both Windows kernel changes and IIS changes.

@Misiu
Copy link

@Misiu Misiu commented May 22, 2019

@davidfowl will this be possible when .NET Core 3 is released?
Ability to host GRPC in App Services is a blocker for me.

@vasquezjames
Copy link

@vasquezjames vasquezjames commented May 29, 2019

Well is May 29 of 2019, and yet there is not signal that this will be possible. I'm looking for host a GRPC service in IIS and add a certificate to use HTTPS :(

@davidfowl
Copy link
Contributor

@davidfowl davidfowl commented May 29, 2019

No it's not possible on IIS, we're working on getting changes but it will be a slow process (as it requires a windows update).

@anisite
Copy link

@anisite anisite commented Jun 5, 2019

I roughly lost about 3 days... thanks iis

@ahmagdy
Copy link

@ahmagdy ahmagdy commented Jul 25, 2019

Hi @davidfowl
Any update?

@Misiu
Copy link

@Misiu Misiu commented Aug 14, 2019

@davidfowl any chance this might get added before .NET Core 3.0 gets released? Or should we wait for 3.1 or 5.0?

@davidfowl
Copy link
Contributor

@davidfowl davidfowl commented Aug 14, 2019

No as it requires windows changes. It’s not going to be part of 3.0 and it will require the latest version of Windows (whatever that is at the time) to get these features. There’s no ETA

@lumogox
Copy link

@lumogox lumogox commented May 19, 2020

Does anyone has some documentation in how to configure nginx with grpc and kestrel?

@davidfowl
Copy link
Contributor

@davidfowl davidfowl commented May 21, 2020

Hey all, can we redirect some of the requests for gRPC in AppService user voice https://feedback.azure.com/forums/169385-web-apps?

@mrcoymeeks
Copy link

@mrcoymeeks mrcoymeeks commented Jun 8, 2020

Quick question: Is support for IIS and Azure App Service coupled together or can/will they be delivered separately?

Thanks yall!

@Pilchie
Copy link
Member

@Pilchie Pilchie commented Jun 8, 2020

They are somewhat coupled - Azure App Service's ingress and windows hosting relies on IIS, so getting support into IIS is a pre-req.

Then App Service needs to deploy based on a build that has those fixes, so App Service will come after IIS support.

@Dhananjay48
Copy link

@Dhananjay48 Dhananjay48 commented Jun 10, 2020

Quick question: I deployed gRPC server on IIS (10.0) and now getting error, "Status(StatusCode=Cancelled, Detail="No grpc-status found on response.")". I have used WebApi project as gRPC client. Anyone can Help me?

@lumogox
Copy link

@lumogox lumogox commented Jun 10, 2020

Quick question: I deployed gRPC server on IIS (10.0) and now getting error, "Status(StatusCode=Cancelled, Detail="No grpc-status found on response.")". I have used WebApi project as gRPC client. Anyone can Help me?

Can't be done, gRCP is not supported by IIS.

@JohnGalt1717
Copy link

@JohnGalt1717 JohnGalt1717 commented Jun 10, 2020

@lumogox @Dhananjay48 Note: GRPC-web is supported by IIS and you lose only client streaming for the most part. So that is a work around, although not a great one.

Otherwise according to what I'm seeing we're waiting until at least December before this gets fixed in IIS so move off and use something else like nginx as a reverse proxy.

@mslot
Copy link

@mslot mslot commented Jun 12, 2020

If you just want to deploy GRPC on Azure App Service, you can do it now with a Linux Container

@EdiWang This is currently not supported on App Service for Linux. We are currently working with App Service to enable this, but I don't have any ETA to share

Is this because there still is HTTP.sys in front of the webapp, even though it is a docker container running on Linux?

@JohnGalt1717
Copy link

@JohnGalt1717 JohnGalt1717 commented Jun 12, 2020

It's my understanding that all app services are reverse proxied by iis. Hence they won't work until this is fixed.

Only something with a public IP or rped by ha or nginx etc (Linux) will work. Kubernetes with nginx or ha work fine as an example but application gateway as ingress won't.

@mslot
Copy link

@mslot mslot commented Jun 12, 2020

It's my understanding that all app services are reverse proxied by iis. Hence they won't work until this is fixed.

Only something with a public IP or rped by ha or nginx etc (Linux) will work. Kubernetes with nginx or ha work fine as an example but application gateway as ingress won't.

It is also my understanding. I actually ended up here because I reading up on if all app services is fronted by an IIS. Because in the docs here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-3.1#when-to-use-kestrel-with-a-reverse-proxy - it advices us to install a reversed proxy in front of kestrel if you are going to expose kestrel to the internet :) I know there is an IIS when running on windows, but I cant find any to validate that HTTP.sys or IIS is also fronting when running docker in an app service. This thread is the closest I have ever come. Funny thing is, that i am subscribing to this thread because i am also pretty much interesting in gPRC :)

@JohnGalt1717
Copy link

@JohnGalt1717 JohnGalt1717 commented Jun 12, 2020

I can confirm that iis also fronts container based app services including Linux ones.

Your only options are VMS where you've done the rp yourself or aks.

@takekazuomi
Copy link

@takekazuomi takekazuomi commented Jun 12, 2020

@davidfowl AppService User Voice has not received much attention.

https://feedback.azure.com/forums/169385-web-apps/suggestions/40585333-grpc-support-in-azure-app-service
Could this be the reason for the slow implementation? As you see this Issue, I think gRPC support is important.

@acrigney
Copy link

@acrigney acrigney commented Jun 12, 2020

@davidfowl
Copy link
Contributor

@davidfowl davidfowl commented Jun 12, 2020

Adding the request there is still very important.

@JohnGalt1717
Copy link

@JohnGalt1717 JohnGalt1717 commented Jun 12, 2020

@davidfowl That's much easier said than done. Try logging in to the site with your microsoft account with new edge. Pops up a new window and does nothing. Try and login with my email, well I forgot the password, password email goes to junk mail for an @outlook.com email address. Change it, login, and no password manager prompts to store the password etc.

Just WOW bad. I'd guess that the Azure team isn't getting good feedback as a result. Hope you can forward this to the right people to fix that mess.

@valentasm1
Copy link

@valentasm1 valentasm1 commented Jun 13, 2020

Maybe it will help to someone to host grpc to iis.
Here is example of working grpcweb Blazor WebAssembly with gRPC-Web code-first approach which hosts to iis via via remote publish like a charm. I assume it could work other ways too. I havent done any performance testing, so i couldnt comment on that, but i think at least it would work good on anything up to middle size solutions.
Here is link to github
It also uses protobuf-net.Grpc.AspNetCore which is no boring protobuff declaration. It is so good when you could go directly to implementation or add extra methods to request/response.

@BrennanConroy BrennanConroy added this to the Discussions milestone Jun 15, 2020
@Dhananjay48
Copy link

@Dhananjay48 Dhananjay48 commented Jun 16, 2020

Hi all, I need to define a string array type dataType in Grpc message. not sure how to do. right now i am doing it as a
repeated string Name = 1,
here i need name field as string array Type. But it is showing error that it is, field is readonly type when bind data in it.

@ahmagdy
Copy link

@ahmagdy ahmagdy commented Jun 16, 2020

@Dhananjay48 This is not StackOverflow. Please ask your question there.
Let's keep this issue for stuff related to gRPC in App Service.

@OzBob
Copy link

@OzBob OzBob commented Jun 25, 2020

It's my understanding that all app services are reverse proxied by iis. Hence they won't work until this is fixed.

Only something with a public IP or rped by ha or nginx etc (Linux) will work. Kubernetes with nginx or ha work fine as an example but application gateway as ingress won't.

Could 'Kestrel used in a reverse proxy configuration' with nginx, be a solution? https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-3.1#when-to-use-kestrel-with-a-reverse-proxy'

I put the suggestion to @JamesNK in the docs, to include an example hosting solution:
dotnet/AspNetCore.Docs#18953

@acrigney
Copy link

@acrigney acrigney commented Jun 25, 2020

@Pilchie
Copy link
Member

@Pilchie Pilchie commented Jul 22, 2020

I just wanted to call out that we've been working with the Windows team to start enabling these scenarios. Here's a blog post from the Windows team about it, and #24120 has some of the follow-up work to expose things in ASP.NET Core.

It'll still be a while before all of this lands, but it's nice to be able to report that we're making progress at least.

@thestamp
Copy link

@thestamp thestamp commented Jul 22, 2020

@Tratcher
Copy link
Contributor

@Tratcher Tratcher commented Jul 22, 2020

I just wanted to call out that we've been working with the Windows team to start enabling these scenarios. Here's a blog post from the Windows team about it, and #24120 has some of the follow-up work to expose things in ASP.NET Core.

It'll still be a while before all of this lands, but it's nice to be able to report that we're making progress at least.

Note this has already been integrated into AspNetCore's HttpSys server in the 5.0 previews. Please give it a try. If we can identify any issues at this layer now then we should have less trouble when we add the IIS layer on top of this.

@Pilchie
Copy link
Member

@Pilchie Pilchie commented Jul 22, 2020

Does this mean I can do full gRPC on IIS if I use ASP.NET Core targetting .NET 5 preview?

Not yet. There are a bunch of different parts here:

  1. Http.sys module in Windows
  2. ASP.NET Core support for this in HttpSysServer
  3. IIS support for this in Windows
  4. ASP.NET Core support for this on IIS
  5. Support for this in the reverse proxy that Azure App Service uses
  6. Azure App Service deploying a build of Windows with 1 and 3.
  7. Azure App Service deploying a build of the reverse proxy from 5
  8. Azure App Service deploying a build of ASP.NET Core with 2 and 4.

What @Tratcher was saying is that 1 and 2 are available in previews of .NET 5. We're working on 3 and 4 right now, but trying 1 and 2 will help give us feedback on whether that will work, since the Http.sys support is an underpinning of the IIS support.

@Pilchie
Copy link
Member

@Pilchie Pilchie commented Jul 22, 2020

Should have said, 1 is available in previews of Windows, and 2 is available in Previews of .NET 5.

@vzalamea
Copy link

@vzalamea vzalamea commented Aug 5, 2020

Windows Insider preview is available with updated http.sys
https://techcommunity.microsoft.com/t5/networking-blog/windows-server-insiders-getting-grpc-support-in-http-sys/ba-p/1534273

Any ideas if this will be available as a Windows update to Windows Server 2016/2019?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.