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: blogs/series-5-devops-data/5.8-azure-post-deployment-config.md
+28-20Lines changed: 28 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ This article is part of the **AngularNetTutorial** series. The full-stack tutori
31
31
**Before following this article, you should have:**
32
32
33
33
***Article 5.6 complete** — IdentityServer deployed at `https://app-talent-ids-dev.azurewebsites.net`
34
-
***Article 5.7 complete** — Angular deployed at the Static Web App URL (e.g., `https://agreeable-desert-01234567.azurestaticapps.net`)
34
+
***Article 5.7 complete** — Angular deployed at the Static Web App URL (e.g., `https://mango-flower-0ced4011e.4.azurestaticapps.net`)
35
35
***The three Azure URLs** — retrieve them:
36
36
37
37
```bash
@@ -58,7 +58,7 @@ az staticwebapp show \
58
58
59
59
## 🎯 The Problem
60
60
61
-
OAuth 2.0 authorization codes and tokens can only flow to URLs that are explicitly registered in the authorization server (IdentityServer). If the Angular application running at `https://agreeable-desert-01234567.azurestaticapps.net` sends an authorization request asking IdentityServer to redirect the browser back to that URL, IdentityServer checks its registered `RedirectUris` for the `TalentManagement` client. If the production URL isn't there, IdentityServer rejects the request immediately with `invalid_redirect_uri`.
61
+
OAuth 2.0 authorization codes and tokens can only flow to URLs that are explicitly registered in the authorization server (IdentityServer). If the Angular application running at `https://mango-flower-0ced4011e.4.azurestaticapps.net` sends an authorization request asking IdentityServer to redirect the browser back to that URL, IdentityServer checks its registered `RedirectUris` for the `TalentManagement` client. If the production URL isn't there, IdentityServer rejects the request immediately with `invalid_redirect_uri`.
62
62
63
63
Similarly, the API's CORS policy controls which origins can call the API from a browser. If the Angular app's domain is not in the allowed origins list, the browser blocks the API response before Angular can read it — even though the API returned HTTP 200.
64
64
@@ -123,7 +123,7 @@ Open `TokenService/Duende-IdentityServer/shared/identityserverdata.json`. Find t
123
123
}
124
124
```
125
125
126
-
Add the production Azure URLs to each list. Replace `https://agreeable-desert-01234567.azurestaticapps.net` with your actual Static Web App URL:
126
+
Add the production Azure URLs to each list. Replace `https://mango-flower-0ced4011e.4.azurestaticapps.net` with your actual Static Web App URL:
127
127
128
128
```json
129
129
{
@@ -136,19 +136,24 @@ Add the production Azure URLs to each list. Replace `https://agreeable-desert-01
Add the Static Web App URL to the allowed origins, then push the change or set it as an App Service setting:
178
+
The API allows CORS origins configured via App Service settings using the `Cors__AllowedOrigins__` array pattern. Two origins are needed — the Azure Static Web App and GitHub Pages:
The API middleware reads this setting at startup and adds the origin to the allowed list.
189
+
**Note:** Replace `https://mango-flower-0ced4011e.4.azurestaticapps.net` with your actual Static Web App URL. The GitHub Pages origin is the host only — no path suffix. This is handled automatically by the `deploy-api.yml` workflow on every deployment, so this manual step is only needed if you are configuring the API outside of a workflow run.
190
+
191
+
The API's CORS middleware reads `Cors:AllowedOrigins` from `IConfiguration` at startup. The `__` double-underscore in the setting name maps to the `:` separator, and the `__0` / `__1` suffixes create an array in .NET configuration.
190
192
191
193
### Step 5: Validate Each Layer in Order
192
194
@@ -240,12 +242,18 @@ After completing Steps 1–4, run through the Layer 1–6 validation in order. E
240
242
**Quick CORS verification from the browser console:**
0 commit comments