C5: Deploy the CoE archetype with APEX (coach)
- Scope
- Member
- Time box
- 90 min
All coach pagesStudent pageSource on GitHub
Import-Kit.ps1 sets *.bicepparam text eol=lf in .gitattributes and Install-DevTools.ps1 installs node 24 LTS and azd on vm-dev01, so /apex-adapt-archetype and azd provision run cleanly on vm-dev01.
Expected evidence
Timing cues: the first 30 minutes are the coach demo; use APEX demo script in the Coach sidebar. By halfway through member work, expect the reviewed preview and one provisioning run. Use the MI wait for starting C6 and running As-Built.
- The member’s own repo (
C:\src\<your-repo>onmainonvm-dev01) withagent-output/university/06-deployment-summary.mdand theagent-output/university/07-*.mdAs-Built suite committed onmain(with any raw subscription/tenant IDs redacted). az resource list -g rg-university-<suffix> -o tableshowing App Service, ACR, SQL MI, Storage (Blob), Service Bus, Key Vault and Application Insights, withpublicNetworkAccessset toDisabledon data backends.
Model answer
- The member’s repo and the archetype are already in place in
C:\src\<your-repo>fromImport-Kit.ps1. If the archetype is missing, run./factory/archetype/Import-Archetype.ps1 -Ref mainfromC:\src\<your-repo>. - Sign in to
azdonvm-dev01(azd auth login --use-device-code) and run/apex-adapt-archetypein agent mode: it reads tenant ID, subscription ID and suffix fromfactory/.local/settings.json, confirms the spoke that vending created before the event exists (rg-spoke,vnet-spoke,snet-app,snet-pe,snet-sqlmi), runs its lightweight governance check, and stops atazd provision --preview. - Review the skill’s preview. Switch from chat to PowerShell 7 in
C:\src\<your-repo>\infra\bicep\universityand run the page’s preflight in that shell before deployment; it exports process variables. If inputs or templates changed since the skill’s preview, rerun and reviewazd provision --previewin the same shell. Runazd provisionthere only after accepting the reviewed changes. - Run agent
08-As-Builtto produce theagent-output/university/07-*.mddeployed-state documentation suite, and commitagent-output/university/onmain. - Confirm no public endpoints beyond the web app’s front end and Application Insights ingestion (the member’s
publicNetworkAccessqueries on Storage, Key Vault, Service Bus and ACR all returnDisabled), naming convention followed, and the web app identity’s six role assignments present: AcrPull, Key Vault Secrets User, Storage Blob Data Contributor, Service Bus Data Sender, Service Bus Data Receiver and Monitoring Metrics Publisher. - SQL MI licensing. The archetype prices SQL MI with Azure Hybrid Benefit (
licenseTypeis'BasePrice'ininfra/bicep/university/modules/sql-mi.bicep). A member without eligible licences changesvar licenseType = 'BasePrice'to'LicenseIncluded'in that file beforeazd provision.
Business outcome check
The outcome is repeatable provisioning. Check that 06-deployment-summary.md and the 07-*.md As-Built record describe the resources the resource listing shows.
Common mistakes
- Treating
azd provision --preview’s partial output as a failure — it only lists resource typesazdhas display names for; SQL MI, the managed identity, role assignments and the maintenance schedule are created even though the preview doesn’t name them. - Skipping the As-Built step because the deployment “obviously worked” — As-Built produces the
07-*.mdartifacts used in C10. - Trying to run
/apex-adapt-archetypefor a member who hasn’t been vended yet — it fails fast with a clear “spoke not found” message. A preflight that stops with “cannot be read” or a missingassign/actionpermission onid-sqlmi-directorymeans vending ran without the member’s-MemberPrincipalId: the team lead re-runs vending with it.
Reset
azd down --purge then redeploy from the member’s repo if something needs a clean restart. It deletes rg-university-<suffix> including the SQL managed instance and, after C7, the migrated database, so only use it before C7, and tell the member first. After the managed instance is deleted, its SQL virtual cluster keeps holding snet-sqlmi for a while, and the preflight stops with “a SQL virtual cluster from a deleted managed instance still holds snet-sqlmi” until Azure releases it (this can take hours). So prefer fixing forward over azd down when you can, and if you do tear down, expect to wait before redeploying. The governance check and spoke vending don’t need to be redone.