Skip to content

Step 4: Vending and collaborator invites (T-1)

Who: Team lead. Once Step 4 finishes, students complete Student onboarding (before Day 1). When: By T-1 (1 day before day one), after Step 2: Foundation and Step 3: Datacenters and Arc are green.

In Step 4, the team lead starts all cohort VMs, runs vending centrally from <event>-lead to connect every workload subscription to the shared hub, collects attendees’ GitHub usernames, invites each student as a Write (push) collaborator to their assigned <event>-student-<nn> repo, and sends each student their private Handoff Card.

Traffic between a member's datacenter and spoke crosses the hub firewall. The shared hub holds Azure Firewall. Each member has a datacenter network with vm-app01 and vm-dev01 and a spoke network with subnets for the app, private endpoints and SQL Managed Instance. Route tables send datacenter-to-spoke traffic and the spoke's outbound traffic to the firewall, and the datacenter's internet traffic leaves through a NAT Gateway.
Step 4 (vending) connects each student's datacenter and spoke to the shared hub firewall, configures DNS and RBAC, and verifies connectivity. Open full size

4.1 Start all datacenter VMs across the cohort

Section titled “4.1 Start all datacenter VMs across the cohort”

Both vm-app01 and vm-dev01 must be running in every workload subscription before vending starts so vm-app01 reports Connected in Azure Arc and the pipeline can restart the VMs and run in-VM connectivity probes.

From factory/ in <event>-lead:

Terminal window
$roster = Get-Content .local/roster.json | ConvertFrom-Json
foreach ($m in $roster) {
az vm start -g rg-datacenter -n vm-app01 --subscription $m.subscriptionId --no-wait
az vm start -g rg-datacenter -n vm-dev01 --subscription $m.subscriptionId --no-wait
}

Wait about 10 minutes after the VMs boot, then verify that every slot’s vm-app01 reports Connected in Azure Arc:

Terminal window
foreach ($m in $roster) {
$arc = az connectedmachine show -g rg-datacenter -n vm-app01 --subscription $m.subscriptionId --query status -o tsv 2>$null
[pscustomobject]@{ Index = $m.index; ArcStatus = $arc ?? 'MISSING' }
}

Do not start vending until every slot in the batch shows Connected.

4.2 Confirm Entra principal IDs and run vending

Section titled “4.2 Confirm Entra principal IDs and run vending”
  1. Confirm memberPrincipalId is populated for every slot in .local/roster.json. Vending grants each slot’s memberPrincipalId:

    • Owner on that slot’s workload subscription,
    • Reader on the shared services subscription, and
    • Managed Identity Operator on id-sqlmi-directory in rg-management.

    Before dispatching, have the group owner sync the reader group from the full private roster. The sync publishes the roster and verification to the lead pipeline. If a workload subscription changed, update the pipeline allowlist first with Initialize-PlatformPipeline.ps1.

  2. Dispatch the vending stage.

    • Up to 50 members:

      Terminal window
      gh workflow run platform.yml -f stage=vending
    • More than 50 members: Phase 1 vends spokes serially so vnet-hub peerings and afwp-hub rule collection groups never collide, which handles roughly 60 to 70 members inside GitHub Actions’ 6-hour (360-minute) single-job limit. Dispatch vending in batches of up to 50 members—waiting for each batch to finish green before dispatching the next (and check the 90-RCG firewall limit in Scaling to larger cohorts):

      Terminal window
      gh workflow run platform.yml -f stage=vending -f members=1-50

      Once 1-50 finishes green:

      Terminal window
      gh workflow run platform.yml -f stage=vending -f members=51-100
  3. Monitor the three vending phases and retry if needed.

    • Phase 1 (serial readiness check and spoke vending): verifies vnet-datacenter and vm-app01 Arc Connected, moves the subscription under mg-factory-corp, builds rg-spoke, peers vnet-spoke and vnet-datacenter to vnet-hub, creates rcg-member-<n>, applies RBAC and the $500 budget, and sets Foundational CSPM. If Phase 1 stops at an unready slot, fix that slot and re-run the same batch (vending is idempotent).

    • Phase 2 (concurrent VM restart): restarts vm-app01 and vm-dev01 across all vended slots in the batch so both VMs pick up the hub firewall’s DNS proxy. If Phase 2 fails, fix the cause and re-run the batch.

    • Phase 3 (concurrent exemptions and connectivity probes): records datacenter policy exemptions where required and runs Test-Connectivity.ps1. If Phase 3 reports failures only for specific indexes, fix the cause and re-run vending for just those indexes:

      Terminal window
      gh workflow run platform.yml -f stage=vending -f members=<indexes>

4.3 Invite students and send private Handoff Cards

Section titled “4.3 Invite students and send private Handoff Cards”

Students use the private repositories created in Step 1, including the readiness evidence pushed in Step 3. After vending, the team lead completes the invitations and shares the Handoff Cards; students do not create new repositories.

  1. Collect each attendee’s GitHub username. Ask every attendee for their GitHub handle (for example octocat) and fill in githubUsername on their assigned slot in factory/.local/roster.json.

  2. Verify GitHub organization collaborator and branch settings. Before sending invites, confirm on your <org> settings:

    • Outside collaborators are allowed if attendees sign in with personal or external partner GitHub accounts rather than organization-member accounts.
    • Direct pushes to main are permitted for Write (push) collaborators on <event>-student-* repositories (no organization rule blocking pushes to main).
  3. Send Write collaborator invitations and generate final Handoff Cards. Run Initialize-CohortRepos.ps1 from factory/ in <event>-lead (pass -CoachTeamSlug or -CoachUsername if granting coach Read access):

    Terminal window
    ./scripts/Initialize-CohortRepos.ps1 `
    -RosterPath .local/roster.json `
    -TemplateRepository '<org>/<event>-student-template' `
    -RepoPrefix '<event>-student' `
    -CoachTeamSlug '<existing-coach-team-slug>'

    For every slot with githubUsername set, the script invites the student as a Write (push) collaborator on <org>/<event>-student-<nn> unless they already have Write access, and writes a complete private Handoff Card to factory/.local/handoff/member-<index>.md. Ensure coaches have Read access to each student repository, using -CoachTeamSlug, -CoachUsername, or a separate grant. The readiness evidence pushed in Step 3 stays in each existing repository.

  4. Send each student their Handoff Card, assigned Entra sign-in details, and labadmin Bastion password privately. Deliver factory/.local/handoff/member-<index>.md over a private direct message or encrypted channel—never in a public channel, issue, or commit—and send them the link to Student onboarding (before Day 1).

Done when vending is green for all 1..n slots, each student has a Write invitation or existing Write access and a private Handoff Card, and coaches have Read access to the student repositories.

Next: students complete Student onboarding (before Day 1).