Getting connection reset while accessing azure container instance

Binod Kumar 20 Reputation points
2025-03-07T07:33:37.9633333+00:00

Hi All,

I have created one docker image using dot net core and successfully pushed the image in container registry. After that I have published the same image in container app and container instance. I am not getting any issue in container app, but getting "the connection was reset" while accessing container instance.

PFB Docker file

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

USER $APP_UID

WORKDIR /app

EXPOSE 8080

EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

ARG BUILD_CONFIGURATION=Release

WORKDIR /src

COPY ["MyAPI/MyAPI.csproj", "MyAPI/"]

RUN dotnet restore "./MyAPI/MyAPI.csproj"

COPY . .

WORKDIR "/src/MyAPI"

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

FROM build AS publish

ARG BUILD_CONFIGURATION=Release

RUN dotnet publish "./MyAPI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final

WORKDIR /app

COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "MyAPI.dll"]

My Container instance properties

  • OS type Linux
  • IP address 130.107.39.53 (Public)
  • SKU Standard
  • Azure Spot -
  • FQDN secondapp.f3creyh2cfg6gjhu.canadacentral.azurecontainer.io
  • DNS name label scope reuse Tenant
  • DNS name label secondapp
  • Ports 80, 8080, 8081
  • Restart policy On failure
  • Container count 1
  • Key management Microsoft-managed keys (MMK)

Please assist

Thanks in advance

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
741 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.