Skip to content

Add containerized SQL Server and EF migrations for local setup - #2

Open
joneja09 wants to merge 1 commit into
cursor/review-auth-api-updates-b700from
cursor/local-sql-migrations-b700
Open

Add containerized SQL Server and EF migrations for local setup#2
joneja09 wants to merge 1 commit into
cursor/review-auth-api-updates-b700from
cursor/local-sql-migrations-b700

Conversation

@joneja09

Copy link
Copy Markdown
Owner

Depends on #1.

Adds a local SQL Server container so this can be a reusable auth provider without Azure SQL, RDS, or another paid database.

Local run (no cloud database)

docker compose up --build

Alternatively:

dotnet run --project Authorization.API.AppHost

The AppHost starts SQL Server in Docker, waits for it, and injects ConnectionStrings:DefaultConnection. Data is kept in a Docker volume.

Also in this PR

  • EF Core InitialCreate migration (Identity + OAuth tables)
  • Database:MigrateOnStartup with retries while SQL Server is booting
  • Development seed: admin, demo user, demo-client, scopes
  • README for the self-hosted (non-Duende) setup

Demo credentials are local-only (admin@localhost / Admin123!, demo@example.com / Password1!, client demo-client / demo-secret).

Verification

  • dotnet test: 10 passed
  • Docker is not available in this agent environment, so the SQL container was not started here. docker compose / Aspire still need Docker Desktop (or Engine) on a developer machine.
Open in Web Open in Cursor 

Run SQL Server in Docker Compose or the Aspire AppHost so local development does not need Azure SQL or another cloud database. Apply migrations and seed demo users/clients on startup.

Co-authored-by: Jeff Jones <joneja09@users.noreply.github.com>
@joneja09
joneja09 marked this pull request as ready for review August 26, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants