Skip to content

fix(workflows): restart App Services after UAMI SQL grant (AB#2228)#8

Merged
emmanuelknafo merged 1 commit into
mainfrom
feature/2228-restart-app-after-uami-grant
May 1, 2026
Merged

fix(workflows): restart App Services after UAMI SQL grant (AB#2228)#8
emmanuelknafo merged 1 commit into
mainfrom
feature/2228-restart-app-after-uami-grant

Conversation

@emmanuelknafo
Copy link
Copy Markdown
Contributor

Summary

Restart the workshop App Services after the deploy workflow adds the UAMI to the SQL admin Entra group, so the API stops returning 500 on the first run.

Why

deploy.yml does azd up first, which starts the API before the UAMI is a SQL admin. Microsoft.Data.SqlClient caches the failed-auth result on the connection pool. The follow-up Grant UAMI SQL access via Entra group step adds the UAMI to azureSqlDBAdmins via Microsoft Graph, but nothing tells the App Service to drop its cached token, so GET /api/establishments keeps returning 500 Internal Server Error until someone restarts the site by hand.

The ADO equivalent (.azuredevops/pipelines/deploy.yml) already solved this with an az webapp restart. This PR ports the same fix to GitHub Actions.

Changes

Step Before After
Grant UAMI SQL access via Entra group Silently swallowed every error with 2>/dev/null Logs the principal, treats only already-a-member as success, fails fast on anything else
(new) Restart App Services to refresh SQL token (AB#2228) n/a Discovers mapaq-* sites in the RG and restarts each; writes the list to the run summary

Validation

  • yamllint / VS Code YAML linter clean
  • After merge, dispatch deploy.yml against workshop-dev: the new restart step should run, GET /api/establishments returns 200 on the first attempt
  • GITHUB_STEP_SUMMARY will list every site that was restarted, for traceability

Out of scope

  • The current rg-dev-001 deployment is already broken with the cached failed-auth state. After this PR merges, the next deploy will self-heal — but I will manually restart mapaq-api-* and mapaq-web-* once now to unblock the user immediately.

Fixes AB#2228

- restart mapaq-* App Services after Entra group-add so SqlClient
  drops the cached failed-auth token captured before membership
- promote silent group-add error to fatal; tolerate already-member
- mirror behaviour of working .azuredevops/pipelines/deploy.yml

Fixes AB#2228

🔁 - Generated by Copilot
@emmanuelknafo emmanuelknafo merged commit b24acec into main May 1, 2026
8 checks passed
@emmanuelknafo emmanuelknafo deleted the feature/2228-restart-app-after-uami-grant branch May 1, 2026 01:42
emmanuelknafo added a commit that referenced this pull request May 1, 2026
Rewrite the root README.md to fully reflect the current codebase and
infrastructure, and add a distinct README.fr.md as its French peer so
the bilingual parity rule from CONTRIBUTING.md is honoured at the repo
root.

README.md updates
- Add bilingual language switcher row linking to README.fr.md.
- Document the full architecture (mermaid) including UAMI, VNet, private
  endpoints, Application Insights and Log Analytics.
- Pin the current tech stack: .NET 10 (10.0.100, latestFeature), EF Core
  10, SqlClient 6.1.1, Azure.Monitor.OpenTelemetry.AspNetCore 1.4.0
  (SamplingRatio = 1.0, TracesPerSecond = null), Microsoft.Identity.Web
  3.5.0, Azure.Identity 1.14.2.
- Expand repository navigation to cover src/, tests/ (xUnit + Locust +
  Playwright), infra/main.bicep + infra/modules/ + infra/scripts/,
  scripts/, slides/, boards/, data/seed/, .github/workflows/,
  .azuredevops/pipelines/ and .devcontainer/.
- Add quick-start, local-dev (in-memory fallback), tests, lab map,
  Bicep parameters and outputs, and CI/CD sections.
- Document the post-provision UAMI-grant + App Service restart pattern
  introduced by AB#2228 / PR #8 in both the GitHub Actions and Azure
  DevOps Pipelines flows.

README.fr.md
- New file mirroring every section of README.md in Quebec French.
- Cross-linked back to README.md at the top.
- Same markdownlint-disable header preserved.

Fixes AB#2229
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.

1 participant