validating-deployments
Skill124 starsChanged 7 months agoMITView on GitHub
End-of-session validation for MI and OBO deployment paths. Use after code changes to verify deploy → test → teardown works end-to-end.
- Reads credentials
In this repository20 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- committing-codeSkill
- deploying-to-azureSkill
- implementing-chat-streamingSkill
- planning-featuresSkill
- researching-azure-ai-sdkSkill
- reviewing-documentationSkill
- syncing-mcp-serversSkill
- testing-cli-compatibilitySkill
- testing-with-playwrightSkill
- triaging-issuesSkill
- troubleshooting-authenticationSkill
- understanding-architectureSkill
- validating-local-setupSkill
- validating-ui-featuresSkill
- writing-bicep-templatesSkill
- writing-csharp-codeSkill
- writing-typescript-codeSkill
- writing-unit-tests-csharpSkill
- writing-unit-tests-typescriptSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run this at the end of any session that changes backend, frontend, infra, or auth code.
- Very specific: line 14
All unit tests pass (dotnet test + npm test)
- Distinctive: line 21
Run before every deployment:
- Distinctive: line 54
Verify: health 200, agent name displayed, chat streaming works, token usage visible.
- Distinctive: line 105
Run smoke test. OBO requires interactive MSAL login (user must sign in with test tenant credentials).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Validating Deployments
Run this at the end of any session that changes backend, frontend, infra, or auth code.
Prerequisites
- All unit tests pass (
dotnet test+npm test) - Frontend builds (
npm run build) - Bicep validates (
az bicep build --file infra/main.bicep) - Playwright installed (
npx playwright install chromium)
Security Checks
Run before every deployment:
# Backend: check for vulnerable NuGet packages
cd backend && dotnet list package --vulnerable
# Frontend: check for vulnerable npm packages
cd frontend && npm audit
# Docker: lint Dockerfile for security issues (if hadolint installed)
hadolint deployment/docker/frontend.DockerfileThe Dockerfile runs as non-root (USER app). Verify this hasn't been removed after changes.
MI Path (Default)
1. Deploy
azd env new mi-test --no-prompt
azd env set ENTRA_SERVICE_MANAGEMENT_REFERENCE "<guid-from-admin>" # Required by some orgs
azd env set AZURE_LOCATION eastus2 --no-prompt
azd up --no-prompt2. Test Remote
$endpoint = azd env get-value WEB_ENDPOINT
node deployment/scripts/smoke-test.js $endpointVerify: health 200, agent name displayed, chat streaming works, token usage visible.
3. Test Local Dev
cd backend/WebApp.Api
$env:ASPNETCORE_ENVIRONMENT = "Development" # CRITICAL — without this, uses ManagedIdentityCredential which fails locally
$env:ASPNETCORE_URLS = "http://localhost:8080"
dotnet watch run --no-launch-profile &
cd ../../frontend
npm run dev &
# Wait for both servers, then:
node deployment/scripts/smoke-test.js http://localhost:51734. Teardown
azd down --force --purge --environment mi-test --no-prompt
# Verify:
# - frontend/.env.local deleted
# - backend/WebApp.Api/.env deleted
# - .azure/mi-test/ deleted
# - Entra app deleted (check azd logs)OBO Path
1. Deploy
azd env new obo-test --no-prompt
azd env set ENABLE_OBO true --no-prompt
azd env set AZURE_LOCATION eastus2 --no-prompt
# No SMR needed if using a non-MSFT tenant
azd up --no-prompt2. Verify OBO Wiring
# Check backend logs for OBO mode
az containerapp logs show --name <app-name> --resource-group <rg> --type console --tail 20 | Select-String "OBO"
# Expected: "OBO mode enabled: backendClientId=..."
# Expected: "Created OBO credential for request" (after first chat)3. Test
Run smoke test. OBO requires interactive MSAL login (user must sign in with test tenant credentials). The smoke test will wait at auth if no cached session exists.
4. Teardown
Same as MI path. Additionally verify:
- Backend API app registration deleted (postdown.ps1 handles this)
- FIC removed with the app
Gotchas
| Gotcha | Detail |
ASPNETCORE_ENVIRONMENT=Development | Required for local dev — without it, backend tries ManagedIdentityCredential which fails on dev machines |
| SMR required | Set ENTRA_SERVICE_MANAGEMENT_REFERENCE or Entra app creation fails |
| Bicep FIC creation may fail | Graph API eventual consistency issue. Workaround: create FIC via az ad app federated-credential create |
v2 agent API requires kind: "prompt" | When creating agents via REST, use definition: { kind: "prompt", model: "...", instructions: "..." } |
OBO scope is api://{BACKEND}/Chat.ReadWrite | NOT api://{SPA}/Chat.ReadWrite. Token audience mismatch = AADSTS500131 |
| AI scope resolves to Azure ML Services | https://ai.azure.com/.default → appId 18a66f5f-... (Azure Machine Learning Services), NOT 7d312290-... (Cognitive Services) |
| Conversation history not user-scoped in MI mode | MI uses shared identity — all users see all conversations |
Related Skills
- testing-with-playwright — Playwright MCP patterns for interactive testing
- validating-ui-features — Step-by-step UI feature validation
- deploying-to-azure — azd commands and troubleshooting
- troubleshooting-authentication — MSAL/JWT debugging
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

