Configure web.config (generated automatically) to forward requests to Kestrel. web.config Example: <aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" /> ✅ IIS acts as a reverse proxy, Kestrel handles HTTP requests. Follow : 2⃣ How to Deploy to Docker?
Docker allows running ASP.NET Core apps in containers, portable across environments.
Dockerfile Example:
# Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /app/out .
ENTRYPOINT ["dotnet", "MyApp.dll"]
Build & Run:
docker build -t myapp:latest .
docker run -d -p 8080:80 myapp:latest
✅ Benefits:
- Environment-independent
- Easy scaling in Kubernetes or cloud
- Versioning via images
3⃣ How to Host in Azure App Service?
Follow :
Azure App Service provides PaaS hosting for ASP.NET Core apps.
Steps: