# Deploy ASP.NET

ASP.NET Core is detected from your project files and runs as a .NET container on port `8080`. No Dockerfile needed - one is [generated](/platform/deployments/builds#dockerfiles-generated-or-your-own) unless the repo has its own.

## Serve it

Kestrel must listen on the routed [port](/create/build-settings#port) on all interfaces. Modern .NET containers default to `8080`; being explicit never hurts:

```
ASPNETCORE_URLS=http://0.0.0.0:8080
```

## Configuration and database

ASP.NET Core's configuration maps [environment variables](/platform/environment-variables#build-time-and-runtime) with double-underscore nesting - `ConnectionStrings__Default` reaches `ConnectionStrings:Default`. From the database's [Credentials tab](/platform/databases/connect):

```
ConnectionStrings__Default=Host=203.0.113.10;Port=5432;Database=mydb;Username=appuser;Password=...;SSL Mode=Require
```

EF Core migrations run at startup (`context.Database.Migrate()`) or from your machine against the same endpoint.

## Scaling

.NET cold starts sit between Go and the JVM - ReadyToRun builds shorten them further. [Scale to zero](/create/scaling#min-instances) works well for APIs; set a warm minimum on latency-sensitive production.

## Related

- [Blazor](/platform/frameworks/blazor): The UI-framework guide on the same runtime.
- [Connect an app](/platform/databases/connect): Connection details for EF Core.
- [Scaling](/create/scaling): Warm minimums and cold starts.
