Grpc application hosted in azure container #2807
Replies: 2 comments
-
I am now trying to use the http protocol and have enable http2 on the port 5000. But I get the below issue while I connect to the client from grpc. Grpc.Core.RpcException: 'Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while HTTP/2 is not enabled.", DebugException="System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionOrHigher while HTTP/2 is not enabled. I have enable http2 in the server for port 5000 webBuilder.ConfigureKestrel(options => Kindly suggest. |
Beta Was this translation helpful? Give feedback.
-
[Triage] We converted the original issue to a discussion topic as this doesn't appear to be a specific issue with the .NET images rather a grpc usage question with the .NET image. You may consider posting this question on https://github.com/grpc/grpc? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ,
I have created a sample Grpc application and have added the docker image to the Azure container registry. Have hosted the same in Azure container and when I am trying to consume the the container url in the client. I get an exception
Status(StatusCode="Internal", Detail="Bad gRPC response. Response protocol downgraded to HTTP/1.1.")'
Program.cs
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup();
webBuilder.ConfigureKestrel(kestrel =>
{
kestrel.ConfigureEndpointDefaults(lo => lo.Protocols = HttpProtocols.Http2);
app settings.json:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Kestrel": {
"EndpointDefaults": {
"Protocols": "Http2"
}
}
}
Docker File:
FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["project/project.csproj", "project/"]
RUN dotnet restore "project/project.csproj"
COPY . .
WORKDIR "/src/project"
RUN dotnet build "project.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "project.csproj" -c Release -o /app/publish
FROM base AS final
ENV ASPNETCORE_URLS="https://+;http://+"
ENV ASPNETCORE_HTTPS_PORT=443
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "project.dll"]
Am I missing anything?
Beta Was this translation helpful? Give feedback.
All reactions