<p>I am trying to run a .net application on AKS. I am building the image using a docker file and using a deployment file to deploy on aks from container registry. Its fails showing status as CrashLoopBackOff.</p>
<p><a href="https://i.stack.imgur.com/ZQCpa.png" rel="nofollow noreferrer">docker file with user and group creation</a>
<a href="https://i.stack.imgur.com/eCZCJ.png" rel="nofollow noreferrer">security context details in deployment.yaml file</a></p>

Shashank Karukonda
<p>I had to change the port to 8080 and it worked after that . It seems we cannot use port 80 for a non root user</p>
<p>and made the following changes in docker file</p>
<pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
RUN addgroup --system  --gid 1000  custom-group &amp;&amp; adduser --system --uid 1000 --ingroup custom-group --shell /bin/sh customuser
USER 1000
WORKDIR /app

#Serve on port 8080, we cannot serve on port 80 with a custom user that is not root
ENV ASPNETCORE_URLS http://+:8080
EXPOSE 8080
</code></pre>
