@@ -36,6 +36,39 @@ When running locally the endpoint is reachable at https://localhost:8100
3636make run # or: dotnet run --project api
3737```
3838
39+ ### Local authentication
40+
41+ Cloud deployments authenticate via Azure Workload Identity (federated
42+ credentials on the sara app registration). Locally you have two options,
43+ selected by ` ASPNETCORE_ENVIRONMENT ` :
44+
45+ - ** ` Local ` (default for ` make run ` )** — uses ` appsettings.Local.json `
46+ with ` AllowedAuthMethods: ["AzureCliBootstrap", "ClientSecret"] ` .
47+ Requires ` az login ` first; the developer's Azure CLI session is used
48+ to bootstrap Key Vault access, and the app registration's client
49+ secret is loaded from Key Vault for subsequent Azure calls.
50+
51+ - ** ` Development ` (mimics deployed dev)** — uses
52+ ` appsettings.Development.json ` with
53+ ` AllowedAuthMethods: ["WorkloadIdentity", "ClientSecret"] ` . Workload
54+ Identity is unavailable outside AKS, so the chain falls through to
55+ ` ClientSecretCredential ` . Provide the secret via an ` api/.env ` file
56+ (gitignored):
57+
58+ ```
59+ AzureAd__ClientSecret=<value of AzureAd--ClientSecret in saradev-kv>
60+ ```
61+
62+ Then run:
63+
64+ ``` bash
65+ ASPNETCORE_ENVIRONMENT=Development dotnet run --project api
66+ ```
67+
68+ Use ` Local ` for normal day-to-day development. Use ` Development ` when
69+ you need behaviour identical to the deployed dev pod (real Postgres,
70+ real OpenTelemetry export, etc.).
71+
3972
4073## Test & format
4174
0 commit comments