The Wayback Machine - https://web.archive.org/web/20220222142703/https://github.com/dotnet/aspnetcore/issues/9020
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 · 267 comments
Open

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

moodya opened this issue Apr 3, 2019 · 267 comments
Milestone

Comments

@moodya
Copy link

@moodya moodya commented Apr 3, 2019

Is it possible to do this? If so how?


2021/12/16 Update - @JamesNK

Azure Container Service can host gRPC services - https://techcommunity.microsoft.com/t5/apps-on-azure-blog/introducing-azure-container-apps-a-serverless-container-service/ba-p/2867265


2020/10/28 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.

Azure no longer uses user voice.

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/

IIS

IIS is supported with .NET 5 and an insiders build of Windows. More info: #9020 (comment)

@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
Contributor

@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
Contributor

@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
Contributor

@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
Member

@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
Member

@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
Member

@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

@acrigney
Copy link

@acrigney acrigney commented Nov 3, 2021

@henriksen
Copy link
Contributor

@henriksen henriksen commented Nov 3, 2021

And container apps would be more expensive than app services?

Not necessarily. It's a different model (serverless) so depending on your app and its usage pattern it could be cheaper, or it could be more expensive. Running an app continuously is roughly comparable to an S1 App Plan. But then it can get cheaper with idle pricing or by scaling down to zero when it's not doing work. If it's intermittent work it could be dead cheap, even free.

@mrivero2020
Copy link

@mrivero2020 mrivero2020 commented Nov 3, 2021

Oner more question. Adding grpc-web to the grpc project as shown here

https://docs.microsoft.com/en-us/aspnet/core/grpc/browser?view=aspnetcore-5.0 titled "Use gRPC in browser apps"

has no impact whatsoever on the "hosting" question. Adding grpc-web to the solution only impacts whether browser based applications can call grpc services directly, right?

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Nov 3, 2021

grpc web doesn't depend on HTTP/2 so it works anywhere.

@JohnGalt1717
Copy link

@JohnGalt1717 JohnGalt1717 commented Nov 3, 2021

grpc web doesn't depend on HTTP/2 so it works anywhere.

... with significantly less efficiency.

But yes, the .net GRPC client implementation will fall back automatically to GRPC-Web if it can't connect fully with regular GRPC. The same is true about the Dart library as well for Flutter.

Which we've leveraged to side step this issue, but it's a VERY significant impact on responsiveness and efficiency.

@mrivero2020
Copy link

@mrivero2020 mrivero2020 commented Nov 3, 2021

I am missing something.

My understanding was that first you create a grpc project (by adding the Grpc.AspNetCore NuGet package). If you want to expose the grpc project to browser applications then you add the Grpc.AspNetCore.Web package and do the proper configuration changes in the startup class. The point of adding grpc web being to expose the grpc services directly to browsers. I mentioned this because we followed the instructions described in the link above to add grpc-web to a project deployed on web apps and "still" does not work.

Are we to understand that by adding grpc-web to a grpc project that alone will make it run from a web app (app services)?

@mrivero2020
Copy link

@mrivero2020 mrivero2020 commented Nov 3, 2021

Finally, since container apps were mentioned above as now supporting grpc services I took a look on azure. To deploy a container app (preview) the options are:

  1. Worskpace (vm)
  2. Microsoft HPC Pack 2012 R2 (vm),
  3. Windows 10 IoT Core Services (Azure service)
  4. Web App (Azure service) --- Is this the same web app that we can't deploy grpc services to if we go the route of app services?
    From the options above, which one will support grpc as of today?

It would be very beneficial if this ASPNET CORE team developed some basic documentation on creating a basic Grpc service AND deploying it to Azure. After all, most of use creating apps with ASPNET CORE technologies look at Azure as the natural hosting solution. But, as far as I can see, there is no documentation that shows how to bring together all these technologies (including hosting).

@JohnGalt1717
Copy link

@JohnGalt1717 JohnGalt1717 commented Nov 3, 2021

I am missing something.

My understanding was that first you create a grpc project (by adding the Grpc.AspNetCore NuGet package). If you want to expose the grpc project to browser applications then you add the Grpc.AspNetCore.Web package and do the proper configuration changes in the startup class. The point of adding grpc web being to expose the grpc services directly to browsers. I mentioned this because we followed the instructions described in the link above to add grpc-web to a project deployed on web apps and "still" does not work.

Are we to understand that by adding grpc-web to a grpc project that alone will make it run from a web app (app services)?

Yes, you create a GRPC project, then add GRPC-Web and then it will work in a browser and .net client apps and dart as 2 examples will automatically fall back if http/2 isn't available or otherwise doesn't connect. It's less than ideal, but works. We did it because we were promised that this would be in production more than a year ago. We finally gave up and put it all in k8s with nginx as the RP.

@takekazuomi
Copy link

@takekazuomi takekazuomi commented Nov 3, 2021

It's a different story from IIS and App Service, but it seems that Azure Container Apps announced by Ignite can be used to host gRPC.
https://www.pulumi.com/blog/azure-container-apps/
https://techcommunity.microsoft.com/t5/apps-on-azure/introducing-azure-container-apps-a-serverless-container-service/ba-p/2867265

Perhaps now we should forget about IIS and App Services.

@valdisiljuconoks
Copy link

@valdisiljuconoks valdisiljuconoks commented Nov 8, 2021

Just took a spin of Container App to run our gRPC service. Probably doing something wrong :D

upstream connect error or disconnect/reset before headers. reset reason: connection termination

@andreasfrosig
Copy link

@andreasfrosig andreasfrosig commented Nov 11, 2021

It's a different story from IIS and App Service, but it seems that Azure Container Apps announced by Ignite can be used to host gRPC. https://www.pulumi.com/blog/azure-container-apps/ https://techcommunity.microsoft.com/t5/apps-on-azure/introducing-azure-container-apps-a-serverless-container-service/ba-p/2867265

Perhaps now we should forget about IIS and App Services.

Have you tried it out? did it work?

@valdisiljuconoks
Copy link

@valdisiljuconoks valdisiljuconoks commented Nov 11, 2021

It's a different story from IIS and App Service, but it seems that Azure Container Apps announced by Ignite can be used to host gRPC. https://www.pulumi.com/blog/azure-container-apps/ https://techcommunity.microsoft.com/t5/apps-on-azure/introducing-azure-container-apps-a-serverless-container-service/ba-p/2867265

Perhaps now we should forget about IIS and App Services.

Have you tried it out? did it work?

One comment up..

@andreasfrosig
Copy link

@andreasfrosig andreasfrosig commented Nov 11, 2021

It's a different story from IIS and App Service, but it seems that Azure Container Apps announced by Ignite can be used to host gRPC. https://www.pulumi.com/blog/azure-container-apps/ https://techcommunity.microsoft.com/t5/apps-on-azure/introducing-azure-container-apps-a-serverless-container-service/ba-p/2867265
Perhaps now we should forget about IIS and App Services.

Have you tried it out? did it work?

One comment up..

Yeah so you did not get it to work, i had hoped @takekazuomi did.
but i see now that he seems to be following your comment, so i guess not.
According to this earlier comment there are a lot of possible approaches, he might have tried an other one:
#9020 (comment)

@valdisiljuconoks
Copy link

@valdisiljuconoks valdisiljuconoks commented Nov 11, 2021

Yeah so you did not get it to work, i had hoped @takekazuomi did. but i see now that he seems to be following your comment, so i guess not. According to this earlier comment there are a lot of possible approaches, he might have tried an other one: #9020 (comment)

We are now running on ACI. BUt of course container app with scaling options would be much nicer approach. now I need to dance with traffic manager to accomplish this.

@andreasfrosig
Copy link

@andreasfrosig andreasfrosig commented Nov 11, 2021

We are now running on ACI. BUt of course container app with scaling options would be much nicer approach. now I need to dance with traffic manager to accomplish this.

Yeah, i have worked very little with ACI, but it does not seem like something i want, but i might be forced to.
This blok got me to search for alternatives, just a bit harder :P
https://blog.tech-fellow.net/2021/01/21/building-real-time-public-transport-tracking-system-on-azure-part-6-packing-everything-up/

@mikeball
Copy link

@mikeball mikeball commented Nov 18, 2021

Just took a spin of Container App to run our gRPC service. Probably doing something wrong :D

upstream connect error or disconnect/reset before headers. reset reason: connection termination

I also was unable to get grpc running on the public app url. I opened an issue asking to clarify how grpc is supported in container apps here microsoft/azure-container-apps#38

UPDATE: Good news, was able to get GRPC running on container apps. See the linked issue for details.

@msftbot
Copy link
Contributor

@msftbot msftbot bot commented Feb 14, 2022

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@msftbot msftbot bot closed this Feb 14, 2022
@Binderbound
Copy link

@Binderbound Binderbound commented Feb 14, 2022

I think this is still something that should be supported by non-container projects. No one is saying anything because there's not much more to say. It should just be done.

@acrigney
Copy link

@acrigney acrigney commented Feb 14, 2022

@Pilchie
Copy link
Member

@Pilchie Pilchie commented Feb 14, 2022

We can keep this open to track it.

@Pilchie Pilchie reopened this Feb 14, 2022
@acrigney
Copy link

@acrigney acrigney commented Feb 14, 2022

@alansiqueira27
Copy link

@alansiqueira27 alansiqueira27 commented Feb 20, 2022

It's been 3 years since the ticket was opened and yet it's still not supported? :(

@acrigney
Copy link

@acrigney acrigney commented Feb 20, 2022

@vzalamea
Copy link

@vzalamea vzalamea commented Feb 20, 2022

I've given up hope on a Windows Update for Windows Server 2019 to fix these http.sys issues in IIS. Can someone from Microsoft just tell us that IIS is dead and that trying to host gRPC on Windows (pre-2022) is futile.

@vasquezjames
Copy link

@vasquezjames vasquezjames commented Feb 20, 2022

@acrigney
Copy link

@acrigney acrigney commented Feb 20, 2022

@angelyordanov
Copy link

@angelyordanov angelyordanov commented Feb 20, 2022

Has anyone tried hosting gRPC on IIS on Windows Server 2022?

On Sat, Feb 19, 2022 at 10:15 PM Vince Zalamea @.> wrote: I've given up hope on a Windows Update for Windows Server 2019 to fix these http.sys issues in IIS. Can someone from Microsoft just tell us that IIS is dead and that trying to host gRPC on Windows (pre-2022) is futile. — Reply to this email directly, view it on GitHub <#9020 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGE3M253HXMLZZ4TQ76VDWTU4BMGLANCNFSM4HDHMSDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you commented.Message ID: @.>

Yes, we are doing it for the last few months in production and its works.

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