dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.83k stars 457 forks source link

.NET Aspire application deployed to Azure Container App does not communicate over HTTP/2 #4733

Open joseph-hungerman opened 4 months ago

joseph-hungerman commented 4 months ago

I have deployed a .NET8 Aspire solution to ACA. The complete solution consists of 6 projects: prometheus container, grafana container, redis container, Blazor Web App, 2 Web APIs. The 2 web APIS leverage gRPC to communicate. When running the solution locally everything works as expected. After deploying to ACA, the application fails. When I have all of the .NET containers set to a transport of http2, the application will not startup giving a protocol error. When switching the Blazor app to auto, it the protocol error gets pushed down to the first API it calls. If I set every .NET container to auto, I get an error stating that HTTP/1.1 requests are not allowed to a gRPC service. All 3 .NET containers need to handle both http1.1 and http2 requests.

davidfowl commented 2 months ago

We ran into many of the gRPC quirks and differences when running locally and on ACA while writing our initial sample. If you want handle http/1.1 and http/2 on the same port then you need to use https.

Can you share the apphost code? Are you cohosting grpc and http APIs in the same application?