Step 1: Cohort repos, roster and preflight (T-14)
Who: Team lead (platform lead). Students do nothing in Steps 1 to 4; they join at Student onboarding (before Day 1).
When: By T-14 (14 days before day one). About 90 minutes for repo setup, roster creation, and the initial whatif preflight.
In Path B (Lead-provisioned cohort), one team lead sets up a single Lead pipeline repository that provisions and tears down the entire n-attendee lab, plus n private student repositories (<org>/<event>-student-01 .. <nn>) with no pipeline credentials. Students never create any GitHub repositories; if the team lead also participates in member challenges alongside students, assign slot 1 (<event>-student-01) to the team lead as well, otherwise keep <event>-lead strictly for cohort operations. Confirm the accounts, permissions, and tools on Requirements before starting.
1.1 Create the lead repo and staging student template repo
Section titled “1.1 Create the lead repo and staging student template repo”Create two operator repositories in your partner GitHub organization from apex-accelerator: one lead repository (<event>-lead) that runs platform.yml, and one staging template repository (<event>-student-template) with the kit pre-imported on main that only Initialize-CohortRepos.ps1 uses to stamp out the n student repos (students never touch <event>-lead or <event>-student-template).
-
Create and import the lead repository (
<org>/<event>-lead). Openapex-accelerator, choose Use this template > Create a new repository, name it<event>-leadunder your partner organization, and set visibility to Private. Clone it in Azure Cloud Shell (PowerShell) into~/src, and import the kit at the repo root:Terminal window mkdir -p ~/srccd ~/srcgit clone https://github.com/<org>/<event>-lead.gitcd <event>-leadcurl -fsSLO https://raw.githubusercontent.com/jonathan-vella/apex-factory-hackathon/main/scripts/Import-Kit.ps1pwsh ./Import-Kit.ps1rm Import-Kit.ps1 -
Commit and merge the lead import to
main. Set your git identity, push the imported kit on afeat/import-kitbranch, open a pull request on GitHub, and merge it intomainso.github/workflows/platform.ymlis on the default branch:Terminal window git config --global user.name "<your name>"git config --global user.email "<your email>"git switch -c feat/import-kitgit add -Agit commit -m "chore: import the factory kit"git push -u origin feat/import-kitMerge the pull request on GitHub, then bring your local clone onto
main:Terminal window git switch main && git pull -
Create and prepare the staging student template (
<org>/<event>-student-template). Create a second Private repository<org>/<event>-student-templatefromapex-accelerator, clone it into a separate folder in Cloud Shell, run the sameImport-Kit.ps1import, and merge itsfeat/import-kitpull request intomain. Verify thatfactory/,app/ContosoUniversity/,.github/,agent-output/university/, andinfra/bicep/university/are all committed onmain. -
Mark
<org>/<event>-student-templateas a GitHub template repository. Authenticateghif needed, then enable template generation soInitialize-CohortRepos.ps1can clonemaincleanly into each student repo:Terminal window gh repo edit <org>/<event>-student-template --template
Done when both <org>/<event>-lead and <org>/<event>-student-template have factory/ on main, and <event>-student-template is enabled as a template repository.
1.2 Sign in, create lead settings, and assemble .local/roster.json
Section titled “1.2 Sign in, create lead settings, and assemble .local/roster.json”Work inside your <event>-lead clone in Azure Cloud Shell (PowerShell).
-
Sign in to Azure and GitHub. Authenticate to the event’s Microsoft Entra tenant and to GitHub:
Terminal window pwshTerminal window az login --tenant '<tenant-id>' --use-device-codegh auth login --hostname github.com --git-protocol https --webgh auth setup-git -
Create
.local/settings.jsonfor the lead repo. Enter the tenant ID, workload subscription#1(or your lead workload subscription), index1, your Azure region (such asswedencentral), and the shared services subscription ID:Terminal window cd factory./scripts/Initialize-Settings.ps1 -
Assemble
factory/.local/roster.jsonfor all1..nattendee slots. Create one object per slot (1..n).factory/.local/is git-ignored; never commit identifiers to git:[{"index": 1,"subscriptionId": "<workload-subscription-id>","memberPrincipalId": "<entra-object-id>","budgetEmail": "<alert-email>","githubUsername": ""}]Field rules for Path B:
index: sequential whole numbers1ton.subscriptionId: dedicated, empty workload subscription for that slot.memberPrincipalId: Entra object ID of a dedicated lab user account, the assigned attendee’s Entra user, or an Entra security group. Required before Step 4 (vending) so the pipeline grantsOwneron the workload subscription,Readeron the shared subscription, andManaged Identity Operatoronid-sqlmi-directory. Make sure each student knows which Entra sign-in identity to use (or is already a member of the group you specified) before Day 1—a GitHub invite alone does not grant Azure access.budgetEmail: recipient for the subscription’s $500 budget alert (at 80%).githubUsername(optional at T-14): leave blank ("") now if attendee names are not finalized yet; fill it in at Step 4 once attendees share their GitHub usernames.suffix(optional): omit on first run soInitialize-CohortRepos.ps1generates a random 6-character lowercase alphanumeric suffix once per slot and persists it to.local/roster.json. Back up.local/roster.jsonprivately after generation so suffixes are never lost.
-
Verify regional vCPU and SQL Managed Instance capacity across all
nsubscriptions. Each attendee slot needs 16 vCPUs ofStandard_D8as_v6(Standard DASv6 Family vCPUsandTotal Regional vCPUs, totaling16 × nvCPUs across thenworkload subscriptions and billing account) plus regional capacity for one General Purpose SQL Managed Instance per workload subscription in C5:Terminal window $s = Get-Content .local/settings.json | ConvertFrom-Json$roster = Get-Content .local/roster.json | ConvertFrom-Jsonforeach ($m in $roster) {Write-Host "=== Slot $($m.index) ==="az vm list-usage --subscription $m.subscriptionId --location $s.location --output table}For both
Total Regional vCPUsandStandard DASv6 Family vCPUsin every subscription, confirmCurrentValue + 16 <= Limit. Then in the Azure portal under Usage + quotas (filtered by your region and each workload subscription), verify Azure SQL Managed Instance regional vCore and subnet quota (Microsoft.Sql), and request increases early through your team lead / event owner if any subscription falls short.
1.3 Stamp out the private student repos
Section titled “1.3 Stamp out the private student repos”From factory/ in <event>-lead, run Initialize-CohortRepos.ps1 (pass -CoachTeamSlug for an existing GitHub team in <org>, -CoachUsername for individual coach accounts, or omit both if you will add coaches later):
./scripts/Initialize-CohortRepos.ps1 ` -RosterPath .local/roster.json ` -TemplateRepository '<org>/<event>-student-template' ` -RepoPrefix '<event>-student' ` -CoachTeamSlug '<existing-coach-team-slug>'What this script does idempotently:
- Creates private repositories
<event>-student-01through<event>-student-<nn>from<org>/<event>-student-templateand tags each with theapex-factory-studenttopic. - Generates a random 6-character
suffixonce per slot and persists it in.local/roster.json(preserving any suffix already recorded—keep a private backup of.local/roster.json). - Grants any specified
-CoachTeamSlugteam or-CoachUsernameusers Read (pull) access to each student repository so coaches can review evidence on event days. - Writes initial private Handoff Cards to
factory/.local/handoff/member-<index>.md.
1.4 Initialize the lead pipeline and run whatif preflight
Section titled “1.4 Initialize the lead pipeline and run whatif preflight”-
Confirm your administrative roles. Your Azure account must hold Owner at Tenant Root (via Global Administrator access elevation), Owner on the shared services subscription, and Owner on every workload subscription in
.local/roster.json(or via an inherited management group). -
Initialize the
Leadpipeline in<event>-lead. Run fromfactory/:Terminal window ./scripts/Initialize-PlatformPipeline.ps1 -RosterPath .local/roster.jsonThis creates
id-factory-pipelineinrg-cicdon the shared services subscription, configures thegh-labenvironment on<event>-lead, and uploads the redacted subscription and roster secrets. Whenever you edit.local/roster.jsonlater, re-run this command sogh-labstays in sync. -
Dispatch the
whatifpreflight stage. RunTest-Preflight.ps1 -Fixacross the cohort to validate permissions and register missing Azure resource providers on every workload subscription:Terminal window gh workflow run platform.yml -f stage=whatifIf your cohort has more than 256 members, stay under GitHub Actions’ 256-job matrix cap by dispatching in index ranges—waiting for each batch to finish green before starting the next (
platform.ymlcancels older queued runs in the same concurrency group):Terminal window gh workflow run platform.yml -f stage=whatif -f members=1-200Once
1-200finishes green:Terminal window gh workflow run platform.yml -f stage=whatif -f members=201-300Approve the run in Actions if prompted. If new resource providers were registered, wait 10 to 15 minutes and dispatch
whatifonce more. Treat anyFAILrow—or a warning onManagement groups—as a blocker before Step 2. -
Complete the organization and licensing checks. Verify these items across your GitHub organization and Azure tenant before T-14:
- GitHub Copilot policy: Copilot Chat, custom agents (
01-Orchestrator,08-As-Built), MCP servers in.mcp.json, and the models used by the Upgrade agent are enabled for attendees. - Outside collaborators (if external attendees): if students use GitHub accounts outside
<org>, confirm the organization policy allows inviting outside collaborators with Write (push) permission on private repositories. - Branch rules on
<event>-student-*: ensure no organization-wide branch protection rule blocks Write (push) collaborators from pushing directly tomainon<event>-student-*repositories. - GitHub Actions billing: check included private-repo Actions minutes, spending limits, and payment method on
<org>, plus Scaling to larger cohorts ifn > 50. - Azure licensing: verify Windows Server Azure Hybrid Benefit eligibility for
vm-app01(or record which slots need-f no-hybrid-benefit=truein Step 3; see Azure Hybrid Benefit) and per-user Windows 11 rights forvm-dev01.
- GitHub Copilot policy: Copilot Chat, custom agents (
Done when <event>-lead’s whatif run reports GO across every roster slot and all organization checks are verified.