First hour with the repo
Orientation: what MikeOSS.Azure is, the invariants that keep the fork mergeable, the code-verified architecture, and where the migration record lives.
Azure / Entra ID migration — issue index
Source documents: docs/AzureMove/, docs/entraId/, docs/Postgres/, docs/storage/, docs/infra/
All issues are AFK (no human approval gate required between them). Work streams can run in parallel where the dependency graph allows.
Current deployment state — 2026-05-05
Infrastructure track (001–006): COMPLETE.
All Azure resources provisioned in rg-mike-dev (uksouth). Schema migrated. All Container Apps healthy.
| Resource | Name | State |
|---|---|---|
| Resource Group | rg-mike-dev |
uksouth |
| VNet | vnet-mike-dev |
10.0.0.0/16 |
| Postgres Flexible Server | pg-mike-dev |
Running, private endpoint, schema applied |
| Container Registry | acrmikedev |
Running |
| Container Apps Environment | cae-mike-dev |
Running, VNet-integrated |
| PostgREST | postgrest (internal) |
Running — http://postgrest (CAE-internal DNS) |
| Backend API | backend |
Running — https://backend.victoriousmoss-0c5f2882.uksouth.azurecontainerapps.io |
| Migration Job | db-migrate |
Last run: succeeded (0000_initial.sql) |
| Key Vault | kv-mike-dev |
Secrets: jwt-secret, pg-admin-password, anthropic-api-key, openai-api-key, openai-base-url |
| Storage Account | stmikedev |
Container: documents |
CI/CD track (007): IN PROGRESS — workflow + OIDC helper landed, awaiting first run against rg-mike-dev.
.github/workflows/deploy.yml builds the backend image via az acr build, runs the db-migrate Container Apps Job to completion, then promotes the backend Container App. OIDC federation is provisioned by scripts/setup-github-oidc.sh. See 007-implementation-plan.md.
Local validation stack: the backend runs against Docker (Postgres 16 + PostgREST v12.2.3 + Caddy + Azurite) with AUTH_PROVIDER=local for the fastest local loop — see docs/runbook-local-stack.md and 008.0-local-auth-provider.md. The frontend and backend also now support AUTH_PROVIDER=entra / NEXT_PUBLIC_AUTH_PROVIDER=entra for local Microsoft login validation — see docs/runbook-entra-local-auth.md.
Auth/code track (008–014): IN PROGRESS.
The app now has provider-dispatched backend auth validation (supabase, local, entra), local frontend auth/token storage, and a backend-owned Microsoft Entra login flow based on the MatterAI provider-selection pattern. Local Microsoft authentication was validated on 2026-05-05. Authenticated data flows still need broader validation with the current local PostgREST/Azurite stack, and the remaining Supabase/PostgREST compatibility boundaries should be isolated before deletion.
Next issue: 016-marketplace-listing.md.
Dependency graph
001 ──► 002 ──► 006 ──► 007
001 ──► 003 ──► 004 ──► 006
001 ──► 005 ──► 006
008 ──► 009 ──► 010 ──► 011 ──► 012 ──► 013 ──► 014
004 ──┘
009 ──────────────────────────────────────► 014
006 ──► 007
006 ──► 015 ◄── 010
Parallel starting points
These can begin immediately with no blockers:
001-bicep-infra-foundation.md— infra track root008-backend-auth-provider-abstraction.md— auth code track root
Issue list
| # | File | Summary | Blocked by | Status |
|---|---|---|---|---|
| 001 | 001-bicep-infra-foundation.md |
VNet, subnets, NAT GW, private DNS, Key Vault | — | ✅ Done |
| 002 | 002-acr-and-postgrest-mirror.md |
Azure Container Registry + PostgREST image mirror script | 001 | ✅ Done |
| 003 | 003-postgres-provisioning.md |
Postgres Flexible Server + private endpoint | 001 | ✅ Done |
| 004 | 004-schema-migration-tooling.md |
node-pg-migrate setup + initial schema (Supabase deps removed) | 003 | ✅ Done |
| 005 | 005-storage-provisioning-and-blob-adapter.md |
Blob storage account + AzureBlobProvider in storage.ts |
001 | ✅ Done |
| 006 | 006-cae-postgrest-backend-deployment.md |
Container Apps Environment, PostgREST, backend, migration job wired together | 002, 003, 004, 005 | ✅ Done |
| 007 | 007-cicd-pipeline.md |
GitHub Actions: build → ACR → migrate → deploy | 006 | 🟡 Implemented, awaiting first dev run |
| 008 | 008-backend-auth-provider-abstraction.md |
auth/types.ts + Supabase provider refactor + AUTH_PROVIDER env toggle |
— | ✅ Done |
| 009 | 009-backend-entra-jwt-validation.md |
providers/entra.ts: JWKS, claim validation, normalized principal |
008 | ✅ Done |
| 010 | 010-tenant-group-enforcement.md |
Tenant lifecycle middleware, group-to-role mapping, tenants + tenant_group_policies tables |
008, 009, 004 | ⬜ Not started |
| 011 | 011-user-bootstrap-and-profile-endpoints.md |
App-level upsertUserProfile replacing trigger; full /user/profile REST surface |
009, 010, 004 | ⬜ Not started |
| 012 | 012-frontend-userprofile-refactor.md |
Move 9 browser PostgREST callsites to Express backend | 011 | ⬜ Not started |
| 013 | 013-frontend-msal-auth-provider.md |
MSAL.js in AuthContext, Microsoft sign-in UX, remove Supabase auth from browser |
009, 012 | ✅ Done |
| 014 | 014-postgrest-jwt-switch-to-jwks.md |
PostgREST validates Entra JWKS; backend uses MI token to call PostgREST | 009, 013 | ✅ Done |
| 015 | 015-managed-identity-db-auth.md |
MI token as Postgres password; remove postgres-admin-password from Key Vault |
006, 010 | ✅ Done |
| 016 | 016-marketplace-listing.md |
Deploy automation script + GitHub Actions OIDC pipeline + Marketplace packaging | 007, 013 | 🟡 Next up |
| 030 | 030-runtime-config-endpoint.md |
GET /config + GET /auth/logout; delete lib/auth-provider.ts; kill NEXT_PUBLIC_ENTRA_* / NEXT_PUBLIC_AUTH_PROVIDER / NEXT_PUBLIC_REDIRECT_URI reads in the frontend so the bundle is portable across tenants |
— | ✅ Done |
| 031 | 031-supabase-placeholder-removal.md |
Lazy getSupabaseClient(); delete NEXT_PUBLIC_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY placeholder workaround |
— | ✅ Done |
| 032 | 032-retire-env-production.md |
Stop committing frontend/.env.production; NEXT_PUBLIC_API_BASE_URL becomes a Docker build-arg; .gitignore whitelist removed |
030, 031 | ✅ Done |
| 033 | 033-deploy-script-build-arg.md |
Update deploy.ps1 to pass --build-arg NEXT_PUBLIC_API_BASE_URL= to az acr build so the post-032 image build keeps working |
032 | ⬜ Not started |
| 034 | 034-execute-tier-a-upstream-prs.md |
Open the two upstream PRs (storage + auth provider boundaries) against the upstream Mike repo. Runbook ready; blocked on the upstream repo URL | — | ⬜ Not started |
| 035 | 035-first-publication-windows.md |
First Tier B (Repo 2) and Tier C (Repo 3) publications. Runbook ready; blocked on repo creation | 033, 034 (preferred) | ⬜ Not started |
Suggested work order (two engineers in parallel)
Engineer A — infra track: 001 → 002 → 003 → 004 → 005 → 006 → 007 → 015
Engineer B — auth/code track: 008 → 009 are done; next validate 010–012 against the current local-first frontend/backend path, then decide whether 013 remains MSAL-based or stays backend-owned as implemented.
006 is the handoff point: B's work can be deployed and tested end-to-end once A completes 006.
Acceptance definition of done (full migration)
- 100 % of auth flows on Entra workforce tenant.
- Zero Supabase calls in any backend or frontend request path.
- All document operations succeed on Azure Blob Storage.
- Postgres queries and migrations stable on Azure Flexible Server.
- No secrets (DB password, JWT HMAC, storage keys) in Key Vault — MI is the only credential primitive.
- CI/CD pipeline deploys from
mainto Azure without manual steps.