Step 3: Datacenter and workstation (T-3)
Path: Path A: Self-service teams (in a lead-provisioned cohort, the team lead deploys the datacenters and attendees follow Student onboarding).
Who: Everyone (every member, including the team lead).
When: By T-3 (3 days before day one). About 35 to 60 minutes unattended for the member stage, plus 30 minutes to set up vm-dev01.
Complete Step 1: Repo and preflight (T-14) first. Run the Step 3.1–3.2 commands from ~/src/<your-repo>/factory in PowerShell (pwsh) inside Azure Cloud Shell. Once vm-dev01 is deployed, you set up C:\src\<your-repo> on vm-dev01 in Step 3.3 and work there for the rest of the event. Your designated team lead is your first point of contact if you hit a problem.
The datacenter starts billing when you deploy it in Step 3 and continues until teardown at T+2, including while its VMs are deallocated. See Cost for per-member rates and event estimates.
Check that you are signed in and load your settings in each new terminal:
az account show --output table$s = Get-Content .local/settings.json | ConvertFrom-Jsonaz account set --subscription $s.subscriptionIdIf az account show fails, sign in again with az login --use-device-code. $s holds subscriptionId, memberIndex, suffix and location.
3.1 Deploy your datacenter and onboard Azure Arc
Section titled “3.1 Deploy your datacenter and onboard Azure Arc”The member stage runs preflight (Test-Preflight.ps1 -Fix), deploys rg-datacenter with vm-app01 (legacy Contoso University on IIS, SQL Server 2022, MSMQ) and vm-dev01 (your Windows 11 workstation), runs Test-Datacenter.ps1 while both VMs are running, and—only if every check passes—connects vm-app01 to Azure Arc.
-
Deploy your datacenter (
T-3, in Azure Cloud Shell —~/src/<your-repo>/factory). Run one command matching your role:-
If you are a team member (indexes
2..n):Terminal window gh workflow run platform.yml -f stage=member -
If you are the team lead (deploying your own slot
1datacenter):Terminal window gh workflow run platform.yml -f stage=member -f members=1
Open the Actions tab on GitHub and approve the run if prompted. (No Windows Server Azure Hybrid Benefit licenses? Append
-f no-hybrid-benefit=trueto this first dispatch and tell your team lead; see Azure Hybrid Benefit.) -
-
Check the test result in the Actions run summary.
Test-Datacenter.ps1checks VM state and size, license type, Trusted Launch (secure boot and vTPM), no public IPs, Azure Bastion Standard, and in-VM checks (IIS up, SQL Server up, and the performance kit’s planted data present). It runs before Arc because Arc turns off the VM run commands that the in-VM checks use. Done when every row is PASS. -
Confirm Azure Arc. In the Azure portal, open Azure Arc > Machines. Done when
vm-app01shows as Connected and SQL Server instances lists its SQL Server instance. Thevendingstage in Step 4 checksvm-app01’s Arc connection automatically before vending your spoke.Onboarding this Azure VM to Arc is a lab-only simulation. In a customer environment, onboard the on-premises servers instead.
If a run fails before Arc onboarding starts, read the run log, fix the cause, and run the same command again. After Arc starts, see If you need to start over.
3.2 Run the first Arc SQL assessment and check Hybrid Benefit
Section titled “3.2 Run the first Arc SQL assessment and check Hybrid Benefit”-
Run the first Arc SQL migration assessment (about 15 minutes). In Azure Arc > SQL Server instances, select the instance on
vm-app01, then Migration > Assessments. Choose Run assessment if needed, open the readiness details and select Azure SQL Managed Instance as the target to review. Export the report or screenshot its findings forContosoUniversity; you triage them in C3. This follows Learn’s assessment instructions, checked 2026-10-30, not a new portal test. Older portal versions use Database migration > Assess source instance > View report. The event owner revalidates the UI before the event. -
Confirm Azure Hybrid Benefit and VM power state (about 5 minutes):
Terminal window az vm list -g rg-datacenter -d -o tableaz vm show -g rg-datacenter -n vm-app01 --query licenseType -o tsvDone when both VMs are running and the second command prints
Windows_Server(orNoneif you usedno-hybrid-benefit=true).
3.3 Set up vm-dev01
Section titled “3.3 Set up vm-dev01”Who runs this: Every team member—including the team lead—for their own vm-dev01.
Why: Every challenge (C1 to C10) runs inside your vm-dev01 workstation in Azure—reaching both GitHub and the private endpoints in your datacenter and spoke network from a single clone (C:\src\<your-repo> on main).
Keep two browser windows open on your own computer: one for Azure Bastion, the other for the Azure portal and this guide (allow portal pop-ups and Bastion clipboard access, and enter device sign-in codes on your own computer where your passkeys and password manager work). Each step below labels where you run it:
[In Azure Cloud Shell —
~/src/<your-repo>/factory] Download your readiness artifact and print yourvm-dev01password, Step 1 suffix, and repo URL:Terminal window cd ~/src/<your-repo>/factory./scripts/Get-PipelineEvidence.ps1$s = Get-Content .local/settings.json | ConvertFrom-Json(Get-Content ".local/$($s.subscriptionId)/datacenter.json" | ConvertFrom-Json).adminPassword$s.subscriptionId$s.suffixgit remote get-url originGet-PipelineEvidence.ps1savesfactory/evidence/readiness/test-datacenter.txtand writes.local/<subscription-id>/datacenter.json. Commit and pushfactory/evidence/readiness/test-datacenter.txtfrom Cloud Shell (git add evidence/readiness/test-datacenter.txt && git commit -m "docs: add readiness test output" && git push), and keep thelabadminpassword,$s.suffix, and repo name for step 3.[On your laptop browser — Azure portal] Connect to
vm-dev01through Bastion so you have a desktop inside the private datacenter network. Filter the portal to your directory and workload subscription, open Resource groups > rg-datacenter > vm-dev01 > Connect > Bastion, select Password, enterlabadminand the password from step 1, and choose Connect. On first sign-in, wait up to five minutes for VS Code extensions to finish installing.[On
vm-dev01— PowerShell 7 (pwsh)] RunInitialize-Workstation.ps1to bootstrapvm-dev01in one command. It installs Node.js 24 LTS andazdif your VM was deployed before the single-clone update, signs you in to GitHub (repo,workflowscopes), Azure CLI, andazd, setsAZURE_TOKEN_CREDENTIALS=AzureCliCredential, detects yourMemberIndexand workload subscription from the VM's private IP and datacenter network. It detects the shared hub subscription only after hub peering exists; for Path A, add it after vending as described in Step 4. It creates (or clones) your private GitHub repository atC:\src\<your-repo>onmain, imports the kit, writesfactory/.local/settings.jsonanddatacenter.json, and opens VS Code:Terminal window New-Item -ItemType Directory -Force C:\LabTools | Out-NullInvoke-WebRequest -Uri 'https://raw.githubusercontent.com/jonathan-vella/apex-factory-hackathon/main/scripts/Initialize-Workstation.ps1' -OutFile C:\LabTools\Initialize-Workstation.ps1pwsh -NoProfile -File C:\LabTools\Initialize-Workstation.ps1 -GitHubOwner '<your-org>' -RepoName '<your-repo>' -Suffix '<suffix>'What Initialize-Workstation.ps1 runs under the hood (manual reference)
If you ever need to run or inspect the individual sign-in, clone, and settings steps by hand in PowerShell 7 (
pwsh) onvm-dev01:Terminal window gh auth login --hostname github.com --git-protocol https --scopes repo,workflow --webgh auth setup-git$u = gh api user | ConvertFrom-Jsongit config --global user.name ($u.name ?? $u.login)git config --global user.email "$($u.id)+$($u.login)@users.noreply.github.com"Terminal window az login --use-device-codeaz account set --subscription '<workload-subscription-id>'az account show --query name -o tsv[Environment]::SetEnvironmentVariable('AZURE_TOKEN_CREDENTIALS', 'AzureCliCredential', 'User')Terminal window git clone https://github.com/<your-org>/<your-repo>.git C:\src\<your-repo>cd C:\src\<your-repo>Terminal window cd C:\src\<your-repo>\factory./scripts/Initialize-Settings.ps1 -TenantId '<tenant-id>' -SubscriptionId '<workload-subscription-id>' -SharedSubscriptionId '<shared-services-subscription-id>' -MemberIndex <index> -Location '<location>' -Suffix '<suffix>' -WriteLabCredentialsTerminal window code C:\src\<your-repo>[On
vm-dev01— VS Code] Trust the workspace authors when prompted, sign in to GitHub Copilot (Accounts icon > Sign in with GitHub to use GitHub Copilot), and configure the Upgrade agent for local execution next to the app: in Extensions, enable GitHub Copilot upgrade and disable GitHub Copilot modernization (for Workspace) if installed. In Copilot Chat, set Session Target to Local, pressF1> MCP: List Servers > Upgrade > Configure Model Access to allow your models, select Upgrade in the agent picker, and send"hello". Also confirm01-Orchestratorand08-As-Builtappear in the agent picker.
Check your setup
Section titled “Check your setup”Run in PowerShell 7 (pwsh) on vm-dev01:
gh auth statusgit config --global user.nameaz account show --query name -o tsv[Environment]::GetEnvironmentVariable('AZURE_TOKEN_CREDENTIALS', 'User')git -C C:\src\<your-repo> branch --show-currentgit -C C:\src\<your-repo> status --short --ignored -- app .github/upgradesGet-Content C:\src\<your-repo>\factory\.local\settings.jsonDone when GitHub is signed in, git has your name, Azure shows your workload subscription, the variable is AzureCliCredential, C:\src\<your-repo> is on main, settings.json has your suffix and memberIndex, and the git status command prints nothing. VS Code must be open on C:\src\<your-repo>, with Upgrade, Local and a Copilot reply to “hello”.
If the git status command lists leftovers under app or .github/upgrades, inspect them before removing files that git does not track:
cd C:\src\<your-repo>git clean -ndx -- app .github/upgradesgit clean -fdx -- app .github/upgradesComing back later
Section titled “Coming back later”Connect to vm-dev01 through Bastion, open PowerShell 7 and run code C:\src\<your-repo>; do not repeat the clone. Read this site in the VM’s browser or on your own computer. All challenge work and working artifacts live in C:\src\<your-repo> on main. Restart only when no agent run is active: a restart ends Bastion and interrupts the run. Never stop or deallocate vm-dev01 during the event.
3.4 Confirm your readiness checklist
Section titled “3.4 Confirm your readiness checklist”Readiness checklist
Section titled “Readiness checklist”Confirm that factory/evidence/readiness/ in C:\src\<your-repo> on main holds test-datacenter.txt (committed in Step 3.3 step 1) and that these readiness checks are complete before Step 4 (T-1):
- Preflight GO. The
whatifrun log, in the member’s Preflight step, showingGO. WARN rows do not prevent GO; confirm the separate manual checks too. - Datacenter test PASS before Arc.
factory/evidence/readiness/test-datacenter.txtcommitted onmainwith every check PASS. - Arc connected, with the SQL extension.
vm-app01showing as Connected under Azure Arc > Machines, and its instance listed under SQL Server instances (checked automatically by Step 4 Vending). - Arc migration assessment ready. Assessment for
ContosoUniversityagainst Azure SQL Managed Instance visible in the portal ready for C3 triage. - Hybrid Benefit and VM state confirmed. Both VMs running and
vm-app01’slicenseTypeverified. vm-dev01and Copilot working.C:\src\<your-repo>cloned onmain,factory/.local/settings.jsonwritten, and Copilot Chat answering"hello"in VS Code onvm-dev01.
Let your team lead know as soon as your Step 3 checklist is complete so they know you are ready for Step 4: Vending (T-1).
For deployment, Arc or DNS errors, check Troubleshooting.
Arc onboarding doesn’t finish
Arc onboarding needs outbound internet through the NAT gateway. Don’t rerun member after onboarding starts: the stage refuses once vm-app01 exists as an Arc machine. If onboarding stopped earlier but disabled its guest agent, a rerun instead fails at the datacenter test; that is not a safe repair path. Read the run log, connect through Bastion as in Switching to vm-dev01 (use vm-app01, same password), and open C:\LabTools\logs\Connect-AppArc.log in Notepad.
Check with your team lead first, or follow If you need to start over.
Save money between sessions
Before the event you can stop both VMs when you’re not working: az vm deallocate -g rg-datacenter -n vm-app01, then the same with -n vm-dev01. Running az vm deallocate releases the VM’s compute and stops its compute billing. Shutting Windows down from inside the VM does not. Bastion, the NAT gateway and the disks bill even when the VMs are stopped.
Start both again before your team lead runs Step 4 at T-1 (az vm start -g rg-datacenter -n vm-app01, then -n vm-dev01), because vending restarts them and runs the connectivity probes inside them. During the event, never stop vm-dev01: it’s your workstation.
If you need to start over
Section titled “If you need to start over”-
Before Arc onboarding starts: fix the error and re-run your Step 3.1
membercommand (gh workflow run platform.yml -f stage=memberfor a team member, orgh workflow run platform.yml -f stage=member -f members=1for the team lead). -
After Arc onboarding starts, before C5:
memberrefuses an existing Arc machine, and a half-onboarded VM has guest run commands disabled. With the event owner’s approval, tear down only your member scope, wait forteardownto finish green in Actions, and then re-runmember:-
If you are a team member (indexes
2..n, in your own repo):Terminal window gh workflow run platform.yml -f stage=teardownOnce
teardownfinishes green:Terminal window gh workflow run platform.yml -f stage=member -
If you are the team lead (recovering your own slot
1—or helping recover one teammate’s<index>—from your lead repo): always pass-f members=<index>so you never tear down the rest of the team:Terminal window gh workflow run platform.yml -f stage=teardown -f members=1Once
teardownfinishes green:Terminal window gh workflow run platform.yml -f stage=member -f members=1
Member cleanup removes
rg-datacenter,rg-spokeand the archetype (including SQL Managed Instance). Repeat Step 3 and thevm-dev01setup afterward. Append-f no-hybrid-benefit=truetomemberif you lack eligible Windows Server licenses, and if your subscription was already vended in Step 4, have the team lead re-rungh workflow run platform.yml -f stage=vending -f members=<index>afterward. -
Next: Step 4: Vending (T-1).