azure container app - blazor - reset reason: remote connection failure, transport failure reason: delayed connect error: 111
Asked Answered
E

1

6

I am attempting to deploy a Blazor Web .net8 app into the Azure Container App. I have a container registry and I can set up a container app to deploy a revision based on a container from the registry just fine.

the revision loads and the startup logs seem fine, with no issues.

however, when attempting to navigate to Application Url - I am getting the error:

upstream connect error or disconnect/reset before headers. retried and the latest reset reason: remote connection failure, transport failure reason: delayed connect error: 111

My Dockerfile seems to be pretty standard:

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src

COPY ["src/Project.Title/Project.Title.csproj", "src/Project.Title/"]
RUN dotnet restore "./src/Project.Title/./Project.Title.csproj"
COPY . .
WORKDIR "/src/src/Project.Title"

RUN dotnet build "./Project.Title.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Project.Title.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Project.Title.dll"]

container app scaling is set from 1 to 10.

here are the ingress settings:

enter image description here

I for the life of me am not able to understand what is the cause of the error: 111 and even what direction I should be looking.

does anyone have a clue of what might be causing this behavior? thanks!

Embrace answered 20/1 at 8:34 Comment(0)
E
5

it appears the problem is .net8 defaults to port 8080 instead of port 80 as per this doc: https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port

changing the ports exposed by docker seems to have resolved the issue:

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 443

also the same port 8080 needs to be indicated on the ingress settings page for the containerized app.

Embrace answered 22/1 at 4:41 Comment(1)
Thanks for the link to the doc. Unfortunately you can still deploy a brand new .net 8 app directly to container apps with 8080 in the Docker and the Ingress and it still doesn't work...Heiner

© 2022 - 2024 — McMap. All rights reserved.