I have pushed the following image to the registry in Azure:
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build WORKDIR /src COPY ["WEBAPI.csproj", ""] RUN dotnet restore "./WEBAPI.csproj" COPY . . WORKDIR "/src/." RUN dotnet build "WEBAPI.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "WEBAPI.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "WEBAPI.dll"]
This is a simple web api.
I have then started a Aazure Container Instance of this, and it starts without problem.
However, when I try to navigate to my api using the generated IP adress, 220.127.116.11 and also the FQDN, dockerapi.northeurope.azurecontainer.io, i can’t access it, and I really don’t know why.
I have followed this guide: https://medium.com/@krishjan05/deploy-a-net-core-web-application-to-azure-container-instance-b016c321b1de
Source: Docker Questions