title: Container runs locally but fails in ACI
body: <p>I created a sample asp.net core application generated by dotnet new web. Added a docker file exposing port 5000.</p>
  <p>Docker file is below</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/aspnet:5.0-focal AS base
  WORKDIR /app
  EXPOSE 5000
  
  ENV ASPNETCORE_URLS=http://+:5000
  
  # Creates a non-root user with an explicit UID and adds permission to access the /app folder
  # For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
  RUN adduser -u 5678 --disabled-password --gecos &quot;&quot; appuser &amp;&amp; chown -R appuser /app
  USER appuser
  
  FROM mcr.microsoft.com/dotnet/sdk:5.0-focal AS build
  WORKDIR /src
  COPY [&quot;Sampleapp.csproj&quot;, &quot;./&quot;]
  RUN dotnet restore &quot;Sampleapp.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/.&quot;
  RUN dotnet build &quot;Sampleapp.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;Sampleapp.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;Sampleapp.dll&quot;]
  </code></pre>
  <p>This works fine when I run it locally on my desktop. However, when I add it to ACR and run it in ACI it fails.</p>
  <pre><code>az container create --resource-group $res_grp `
                      --name $aci_container_name `
                      --image $image_name `
                      --registry-login-server $registry_login_server `
                      --registry-username $akv_pull_usernamevalue `
                      --registry-password $akv_pullpasswordvalue `
                      --dns-name-label $dns_name_label `
                      --output table
  
  Name              ResourceGroup       Status    Image                                                 IP:ports          Network    CPU/Memory       OsType    Location
  ----------------  ------------------  --------  ----------------------------------------------------  ----------------  ---------  ---------------  --------  -------------
  aci0734container  containerbasics_rg  Running   devcontainerregistry0734.azurecr.io/helloacrworld:v1  20.53.163.177:80  Public     1.0 core/1.5 gb  Linux     australiaeast
  
  </code></pre>
  <p>There are no error logs too.</p>
  <pre><code>az container logs --resource-group containerbasics_rg --name aci0734container
  
  info: Microsoft.Hosting.Lifetime[0]
        Now listening on: http://[::]:5000
  info: Microsoft.Hosting.Lifetime[0]
        Application started. Press Ctrl+C to shut down.
  info: Microsoft.Hosting.Lifetime[0]
        Hosting environment: Production
  info: Microsoft.Hosting.Lifetime[0]
        Content root path: /app
  </code></pre>
  <p>When I try to curl this is response</p>
  <pre><code>curl http://20.53.163.177:5000
  curl : Unable to connect to the remote server
  At line:1 char:1
  + curl http://20.53.163.177:5000
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  <p>When I run it locally I map the destination port but ACI does not allow port mapping. Is that the issue?</p>