Skip to content

Step 4: Vending (T-1)

Path: Path A: Self-service teams (in a lead-provisioned cohort, follow Step 4: Vending and invites instead). Who: Everyone starts their VMs; the Team lead runs the vending stage; Members save the shared services subscription ID. When: By T-1 (1 day before day one), after Step 2: Foundation and every member’s Step 3: Datacenter and workstation are complete. See the stage timing table.

Vending places each workload subscription under mg-factory-corp, builds rg-spoke with subnets, route tables and NSGs, peers the spoke/datacenter to the hub, sets hub DNS, restarts both VMs, records exemptions if needed, and tests connectivity. It also creates the firewall rule collection group rcg-member-<n>, grants workload Owner and shared-services Reader/Managed Identity Operator as required, adds a subscription-scoped $500 budget with an 80% alert to the roster email, and sets Foundational CSPM only (paid Defender plans off). Verify these shared changes, not just rg-spoke.

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.
What Step 4 (vending) connects: routes and DNS across each member's datacenter, the shared hub firewall, and the vended spoke. Open full size

Before the team lead starts the vending stage, every member (including the team lead) must have vm-app01 and vm-dev01 running so the pipeline can restart them and run the in-VM connectivity probes.

From Azure Cloud Shell (or C:\src\<your-repo>\factory on vm-dev01):

Terminal window
$s = Get-Content .local/settings.json | ConvertFrom-Json
az vm start -g rg-datacenter -n vm-app01 --subscription $s.subscriptionId
az vm start -g rg-datacenter -n vm-dev01 --subscription $s.subscriptionId

If you have an open Bastion session to vm-dev01, save your work: the VM restart during vending will disconnect your session.

After starting the VMs, allow about 10 minutes and check Azure Arc > Machines > vm-app01 > Connected before telling the team lead you are ready. VM Running alone is not the vending readiness check.

Before dispatching vending, the designated Entra group owner syncs the reader group from the full private roster. The stage rejects missing or stale roster verification, even when vending only a batch. From factory/ in the team lead’s repository, start the stage:

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

Open the Actions tab on GitHub and approve the run if asked. The stage runs in three phases:

  1. Automatic readiness check and spoke vending (one member at a time): for each member in roster.json, the pipeline verifies that vnet-datacenter exists and vm-app01 is connected to Azure Arc (Connected), then runs Deploy-Vending.ps1. If a member has not finished Step 3, the stage stops at the first unready member. Earlier members are vended but not restarted, exempted or probed; later members are not vended.
  2. Parallel VM restart: restarts vm-app01 and vm-dev01 for all vended members at once so they pick up the hub firewall’s DNS proxy.
  3. Parallel exemptions and connectivity probes: runs New-DatacenterExemptions.ps1 and Test-Connectivity.ps1 for every vended member.

If phase 1 stops at an unready member, or phase 2 fails while restarting VMs, fix the cause and re-run vending for all members. It is safe to repeat. For large cohorts (more than about 60 members), run vending in index batches such as -f members=1-50 and -f members=51-100—waiting for each batch to finish green before dispatching the next—so each job stays within GitHub Actions’ 360-minute limit. If phase 3 names members whose exemptions or connectivity probes failed, fix the cause and re-run only for those named indexes:

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

When the run is green, post “vended” in your team’s private channel along with the shared services subscription ID so your teammates can save it in 4.3.

4.3 Save the shared services subscription ID (Members)

Section titled “4.3 Save the shared services subscription ID (Members)”

Who: Team members (2..n) only—the team lead already saved sharedSubscriptionId in Step 1.4. Once the team lead confirms that Step 4 is green and shares the shared services subscription ID in your private team channel, each team member saves it in C:\src\<your-repo>\factory\.local\settings.json on vm-dev01:

Terminal window
cd C:\src\<your-repo>\factory
./scripts/Initialize-Settings.ps1 -SharedSubscriptionId '<shared-services-subscription-id>'

Re-running Initialize-Settings.ps1 with -SharedSubscriptionId keeps your existing tenantId, subscriptionId, memberIndex, location, and suffix unchanged.

Done when vending is green for every member on the roster and .local/settings.json holds sharedSubscriptionId.

Check the vending and DNS entries in Troubleshooting and share the failing phase with your team lead.

Next: on Day 1 at 08:30, join the tech lead’s 30-minute hackathon introduction, then start C1: Define the opportunity at 09:00.