You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,41 @@ The sample apps work immediately without any Azure or Entra ID configuration. Th
85
85
86
86
> **Note:** The "Sign In" button will fail until you complete Exercise 1 (Entra ID app registration). The API endpoints are fully functional without authentication in dev mode.
87
87
88
+
### Bootstrap Entra ID App Registrations (PowerShell)
89
+
90
+
[scripts/setup-entra-apps.ps1](scripts/setup-entra-apps.ps1) is an idempotent PowerShell helper that creates the SPA and API app registrations against the tenant you are currently logged in to with the Azure CLI. It is the fastest path through Exercise 1 if you prefer scripting over the Azure Portal.
91
+
92
+
What it does today (Phase 1):
93
+
94
+
- Verifies `az` is installed and you are signed in (`az login`).
95
+
- Acquires a Microsoft Graph access token and calls Graph directly via `Invoke-RestMethod` (no `az rest` quoting issues on Windows).
96
+
- Creates the **API app** and sets its Application ID URI to `api://<appId>`.
97
+
- Creates the **SPA app** and configures its SPA platform redirect URI (default `http://localhost:4200`).
98
+
- On re-run, looks each app up by `displayName` and reuses it instead of creating duplicates. Every step is a no-op if already configured.
99
+
100
+
Usage:
101
+
102
+
```powershell
103
+
# Sign in to the tenant where the apps should live
104
+
az login --tenant <tenantId>
105
+
106
+
# Bootstrap both app registrations
107
+
.\scripts\setup-entra-apps.ps1 `
108
+
-SpaName "Evidence Portal SPA" `
109
+
-ApiName "Evidence Portal API"
110
+
111
+
# Optional: capture the resulting IDs for downstream automation (e.g. deploy.ps1)
112
+
.\scripts\setup-entra-apps.ps1 `
113
+
-SpaName "Evidence Portal SPA" `
114
+
-ApiName "Evidence Portal API" `
115
+
-RedirectUri "https://my-spa.azurewebsites.net" `
116
+
-OutputFile ".\.entra-apps.json"
117
+
```
118
+
119
+
The script returns and prints `tenantId`, `apiAppId`, `apiObjectId`, `identifierUri`, `spaAppId`, `spaObjectId`, and `redirectUri`. Plug `tenantId`, `apiAppId`, and `spaAppId` into [`environment.ts`](sample-app/spa/src/environments/environment.ts) and [`application.properties`](sample-app/api/src/main/resources/application.properties) (or pass them to [scripts/deploy.ps1](scripts/deploy.ps1)).
120
+
121
+
> **Phase 2 (planned):** the same script will be extended via Microsoft Graph to expose the `Evidence.Read` scope, define `CaseReader` / `CaseAdmin` app roles, add the SPA's delegated permission on the API, pre-authorize the SPA, and grant tenant admin consent. Until then, complete those steps in the Azure Portal as described in [Exercise 1](workshop/guides/exercise-1-app-registrations.md).
122
+
88
123
### Workshop Exercises
89
124
90
125
Follow these exercises in order for the full 3-hour workshop experience:
@@ -125,7 +160,8 @@ msal-java/
125
160
│ ├── start.sh # Start both apps locally (macOS/Linux)
126
161
│ ├── deploy.ps1 # Full Azure deployment (PowerShell)
0 commit comments