Skip to content

APEX

For: every member deploying their own archetype.

When: C5.

Before you start: complete Step 4: Vending and C4’s target-state decisions, and open C:\src\<your-repo> in VS Code on vm-dev01. C5 holds the requirements and acceptance bar.

What APEX does here, and what it doesn’t

Section titled “What APEX does here, and what it doesn’t”

APEX agents adapt the archetype template and document the result. They don’t deploy it. Deployment is azd provision, run by you on vm-dev01. That’s a design choice of this kit: a human approves every live change to Azure.

You did this in Step 1: Repo and preflight (or your team lead did it in Path B): your repo is created from the apex-accelerator template, and Import-Kit.ps1 copied the kit into factory/, enforced LF line endings on *.bicepparam in .gitattributes, and imported the archetype’s APEX project into the repo root (agent-output/university/, infra/bicep/university/ and the /apex-adapt-archetype skill). Edit and deploy only the root copy in C:\src\<your-repo>.

To redo only the archetype import, run ./factory/archetype/Import-Archetype.ps1 -Force from C:\src\<your-repo>. -Force replaces your copy of the archetype, so you lose any changes you made to it.

azd is the Azure Developer CLI, preinstalled on vm-dev01 (overview). It keeps its own sign-in, separate from az login. In a PowerShell 7 (pwsh) terminal on vm-dev01, run azd auth login --use-device-code and follow the prompt, unless azd already tells you that you’re signed in. Complete both az login and azd auth login with MFA so tenant-level MFA enforcement policies do not reject deployment writes with RequestDisallowedByPolicy.

Run the /apex-adapt-archetype skill in VS Code’s built-in agent mode on vm-dev01: open Copilot Chat, choose Agent in the mode picker (not the 01-Orchestrator custom mode, because this flow doesn’t need the full orchestrator) and type /apex-adapt-archetype. It reads your tenant ID, subscription ID and suffix from factory/.local/settings.json and asks you to confirm them. The suffix is the random six-character string of lowercase letters and digits that Initialize-Settings.ps1 gave you; don’t change it, because every later <suffix> command and resource name uses it. The skill then checks a spoke is already vended for you (if it isn’t, your team lead runs the vending stage for you; members can’t), runs a lightweight check of your tenant’s Deny policies against the archetype’s packaged governance constraints, creates an azd environment, and stops at azd provision --preview.

Review the preview output and C5’s SQL MI licence check, then run azd provision yourself in C:\src\<your-repo>\infra\bicep\university (where azure.yaml is), in the same terminal as preflight. If you closed it, open PowerShell 7 on vm-dev01 at C:\src\<your-repo> and load the settings explicitly:

Terminal window
cd C:\src\<your-repo>\infra\bicep\university
$s = Get-Content ..\..\..\factory\.local\settings.json | ConvertFrom-Json
./scripts/preflight.ps1 -TenantId $s.tenantId -SubscriptionId $s.subscriptionId -Suffix $s.suffix
azd provision --preview

Review the preview before running azd provision. Deployment waits for the SQL Managed Instance and takes about 20 minutes (measured: 22 min 59 s on 2026-10-08, 20 min 2 s on 2026-10-20), so you can start C6 meanwhile. Hooks run preflight, post-deploy tests and a deployment summary automatically.

In Copilot Chat, pick the 08-As-Built agent and ask it to document the deployed state. It produces the agent-output/university/07-*.md documentation suite (for example 07-documentation-index.md), recording what was actually deployed, and takes about 30 minutes. If azd prints an apex-recall ... command, run that first in its terminal.

The fallback runs a plain az deployment sub create against the same Bicep, with no agent and no azd. It’s an optional path, not the primary one: the primary path’s agent-plus-azd split keeps a human approving every live change. From your repo’s root folder, preview, then deploy:

Terminal window
cd C:\src\<your-repo>\factory
$s = Get-Content .local/settings.json | ConvertFrom-Json
./archetype/deploy.ps1 -TenantId $s.tenantId -SubscriptionId $s.subscriptionId -Suffix $s.suffix -WhatIf
./archetype/deploy.ps1 -TenantId $s.tenantId -SubscriptionId $s.subscriptionId -Suffix $s.suffix

The kit supports azd and this fallback. APEX Deploy (07b-Bicep Deploy) also works, but it is unsupported during the event and coaches do not support it; use the azd path above.

  • The archetype now gives its deployer the Monitoring Metrics Publisher role on Application Insights, which C6’s OpenTelemetry check (task 06) and C8’s telemetry checks need. A deployment that lacks it needs the grant run once by you: the playbook has the one-time command for your own sign-in.