Tools and References

For a hands-on warm-up instead of a reference, see Getting Comfortable with the Tools.


🧰 Applications

Visual Studio Code

  • Install: winget install Microsoft.VisualStudioCode Β· download
  • This repo recommends extensions automatically (.vscode/extensions.json) β€” accept the prompt when you first open the folder.
  • Docs: https://code.visualstudio.com/docs

GitHub Copilot (agent mode)

  • Install the GitHub Copilot and GitHub Copilot Chat extensions in VS Code, then sign in with your GitHub account.
  • Open chat with Ctrl+Alt+I and set the mode dropdown to Agent. Agent mode reads and edits multiple files and runs terminal commands (like az bicep build) with your approval.
  • Docs: https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode Β· https://docs.github.com/copilot

Bicep extension for VS Code

  • Marketplace ID: ms-azuretools.vscode-bicep
  • Gives IntelliSense for AVM module parameters β€” hover any br/public:avm/... reference to see the module’s parameter docs.
  • Docs: https://learn.microsoft.com/azure/azure-resource-manager/bicep/visual-studio-code

Windows Terminal

  • Install: winget install Microsoft.WindowsTerminal
  • Recommended shell for the workshop β€” supports PowerShell 7 tabs and a cleaner experience than the default console.

Git and GitHub Desktop

  • Git: winget install Git.Git Β· git-scm.com
  • GitHub Desktop: winget install GitHub.GitHubDesktop Β· desktop.github.com β€” used in the labs for clone/commit/push without needing to memorise git commands.
  • Docs: https://docs.github.com/desktop

πŸ’» CLIs

Azure CLI (az)

  • Install: winget install Microsoft.AzureCLI Β· install docs
  • Sign in: az login Β· Select subscription: az account set --subscription "<name-or-id>"
  • Key commands in this workshop: az deployment group create, az deployment group what-if, az group show, az vm run-command invoke, az sql failover-group set-primary

Bicep CLI

  • Install via Azure CLI: az bicep install Β· Upgrade: az bicep upgrade
  • Key commands: az bicep build --file <f> (compile + lint), az bicep restore (pull AVM modules from registry), az bicep build-params --file <f>.bicepparam
  • Docs: https://learn.microsoft.com/azure/azure-resource-manager/bicep/

GitHub CLI (gh)

  • Install: winget install GitHub.cli Β· cli.github.com
  • Sign in: gh auth login
  • Used for: secrets (gh secret set), variables (gh variable set), running workflows (gh workflow run "Curriculum L1.1 - Core Deployment"), monitoring runs (gh run watch)

PowerShell 7 (pwsh)

  • Install: winget install Microsoft.PowerShell
  • Required for the setup and cleanup scripts. PowerShell 5 (built into Windows) also works for most commands, but PS7 is recommended.

πŸ—‚οΈ Repo scripts (scripts/)

PowerShell helpers you run on your own machine (requires PowerShell 7 + signed-in az and gh).

Install-LabTools.ps1

  • One-command workstation setup: installs all tools above, configures git, installs VS Code extensions, signs you into GitHub and Azure.
  • Run as Administrator: ./scripts/Install-LabTools.ps1
  • Idempotent β€” already-installed tools are skipped.

Connect-AzureAndGitHub.ps1 β€” self-hosted only

  • Fork + auth helper: validates Azure/GitHub auth, creates your GitHub fork, and verifies gh copilot is available.
  • Classroom accounts never run this β€” your fork is pre-created; just open it in the browser.
  • Typical use (after gh auth login): ./scripts/Connect-AzureAndGitHub.ps1
  • Idempotent β€” existing fork/auth state is detected and reused.

Load-LabSettings.ps1

  • Loads your lab values from lab-settings.csv into environment variables for the current terminal session.
  • Copy lab-settings.csv.example β†’ lab-settings.csv, fill in your values, then run: ./scripts/Load-LabSettings.ps1
  • Use -Persist once to save variables so they survive terminal restarts. Windows only β€” .NET has no user environment store on macOS or Linux, and the script says so instead of silently saving nothing.
  • -Persist stores your VM and SQL passwords in plain text (HKCU\Environment). Fine for a throwaway lab machine; remove them afterwards on your own machine with ./scripts/Load-LabSettings.ps1 -Clear.

Clear-LabCredentials.ps1

  • Takes the lab off your machine: signs out of az and gh, removes the values -Persist saved, and deletes lab-settings.csv (which holds your passwords in plain text).
  • Deletes nothing in Azure. It checks first and warns if resources are still deployed, because once you are signed out you can no longer tear them down and they keep billing.
  • Always preview: ./scripts/Clear-LabCredentials.ps1 -WhatIf Β· Keep your values for a later run with -KeepSettingsFile.
  • Full walkthrough: Cleanup & Reset.

Setup-Oidc.ps1 β€” self-hosted only

  • One-command GitHub↔Azure OIDC handshake: creates the Entra app registration, adds the federated credentials, grants Contributor on your resource group, and pushes all repo secrets and variables.
  • Each credential is the exact subject GitHub sends for your fork (ID-enriched for forks created after 15 Jul 2026), read from GitHub’s API β€” never a wildcard. It stays an app registration rather than the classroom’s managed identity because a managed identity would live in your lab group, which teardown empties.
  • Classroom accounts never run this (Reader role, and no need β€” your own workshop identity is already federated to your fork, and its IDs come from your instructor).
  • Always preview first: ./scripts/Setup-Oidc.ps1 -ResourceGroup "<your-rg>" -Prefix "<yourname>" -WhatIf β€” -ResourceGroup is required on every run, preview included, and the group must already exist.
  • Idempotent β€” re-running refreshes the identity and resource-group secrets, and keeps existing VM/SQL passwords so they still match anything already deployed.
  • Full walkthrough: Deployment Guide β†’ self-hosted appendix.

Why these scripts pipe secrets in instead of using --body - (maintainer note)</summary>

Both OIDC scripts set secrets by piping the value and passing no --body:

$value | gh secret set NAME --repo $repo      # correct
$value | gh secret set NAME --repo $repo --body -   # WRONG: stores the literal "-"

gh reads a value from standard input only when --body is absent. Its own flag help says so, identically for both commands:

$ gh secret set --help
  -b, --body string   The value for the secret (reads from standard input if not specified)

$ gh variable set --help
  -b, --body string   The value for the variable (reads from standard input if not specified)

--body - specifies a value, so stdin is never read and the secret is stored as the one-character string -. Every azure/login then fails with an opaque AAD error, because a stored secret β€” even a one-character garbage one β€” always overrides a variable of the same name.

This has been confirmed against the real client (gh 2.63.2), by pointing it at a local HTTPS server and reading the request it actually sent. A repo secret is encrypted client-side with a libsodium sealed box, which is exactly 48 bytes larger than its plaintext β€” so the ciphertext length recovers the plaintext length without ever decrypting anything. Piping the 9-character string realvalue both ways:

invocation ciphertext plaintext length
gh secret set X --body - 49 B 1 β€” the literal -, stdin discarded
echo … \| gh secret set X 57 B 9 β€” realvalue, read from stdin

That length of 1 is the bug. Nothing about it is specific to this repo or to Azure.

Re-checking it yourself, using a variable. A secret cannot be read back, so confirming a stored value normally needs a throwaway workflow that echoes its length. A variable can be read back directly, which turns the check into two commands. gh variable set and gh secret set are separate commands that share the --body semantics quoted above β€” and the same local capture showed variable set --body - putting {"name":"…","value":"-"} on the wire β€” so the variable is a faithful stand-in:

# On a fork you don't mind writing to:
echo "realvalue" | gh variable set TEST_BODY_DASH --repo OWNER/REPO --body -
gh variable get TEST_BODY_DASH --repo OWNER/REPO

# Cleanup
gh variable delete TEST_BODY_DASH --repo OWNER/REPO

- confirms the behaviour these scripts work around. realvalue would mean a future gh release changed it, and the piping could be reverted.

</details>

Cleanup-Labs.ps1 β€” self-hosted only

  • Deletes every resource inside your lab resource group β€” all labs share one group, so this clears them in one run. The group itself is kept.
  • Classroom accounts use the β€œTeardown labs” workflow instead (Actions tab β€” dry-run by default, type DELETE to confirm). Reader on the group means this script cannot delete anything for you.
  • Always preview first: ./scripts/Cleanup-Labs.ps1 -ResourceGroup $env:AZURE_RESOURCE_GROUP -WhatIf
  • Leave -ResourceGroup off and it falls back to the AZURE_RESOURCE_GROUP environment variable.
  • Add -RemoveOidc to also delete the Entra app registration and its role assignment. Self-hosted only β€” in the classroom your deploy identity is a managed identity that the instructor’s teardown removes; there is no app here to delete.

πŸ”’ Admin scripts (scripts/admin/) β€” Instructor only

These scripts run under the Azure CLI and PowerShell 7.2+. The one-time bootstrap needs Owner on the subscription; after that the class can be built and removed from a GitHub Actions workflow in a private copy of the repo, with no Entra admin role and no Microsoft Graph permission anywhere. Set-LabPolicy.ps1 and Enable-DefenderPlans.ps1 deploy Bicep templates through the Azure CLI. Students never run these. Walkthrough: Instructor Environment Setup.

New-WorkshopBootstrap.ps1

  • Once per subscription, locally: creates the automation managed identity with one federated credential (your private admin repo’s workshop-admin environment), a custom role limited to resource groups and managed identities, and Role Based Access Control Administrator conditioned to Contributor for service principals other than itself.
  • Prints the repository variables and the WORKSHOP_ROSTER_CSV secret to set; never sets them itself.
  • Always preview first: ./scripts/admin/New-WorkshopBootstrap.ps1 -TenantId <tenant-id> -SubscriptionId <subscription-id> -AdminRepository <owner>/<private-copy> -WhatIf

New-WorkshopEnvironment.ps1

  • Reads workshop-roster.csv (gitignored; columns GitHubUsername, optional EntraUpn, AzurePrefix, Repository). Tenant, subscription, region and event name are parameters.
  • Per student: a resource group named after their GitHub account (the workflows target it by fork-owner name), a managed identity with one explicit federated credential for their fork’s main branch, and Contributor on that group only. No shared identity, no wildcard trust.
  • Writes workshop-client-ids.csv (gitignored) with each student’s AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID, AZURE_PREFIX and AZURE_LOCATION. Share each row privately; -SetForkVariables sets them on forks you administer.
  • Always preview first: ./scripts/admin/New-WorkshopEnvironment.ps1 -EventName MyEvent -SubscriptionId <subscription-id> -WhatIf
  • Idempotent β€” re-run to add late students or pick up late forks. Supersedes New-LabEnvironment.ps1 and Setup-OidcAll.ps1.

Remove-WorkshopEnvironment.ps1

  • Deletes everything tagged ManagedBy=workshop-environment and Event=<event>, and nothing else: student groups (with the lab resources in them) and the event’s identities.
  • Always preview first: ./scripts/admin/Remove-WorkshopEnvironment.ps1 -EventName MyEvent -SubscriptionId <subscription-id> -WhatIf

Set-LabPolicy.ps1

  • Assigns 6 Azure Policy assignments to every student resource group:
    • Allowed locations β€” restricts deployments to eastus2 and westus2 (L1.4’s failover region)
    • Allowed resource types β€” whitelist of ~38 types used by L1.1–L1.4 labs
    • Inherit tag Γ— 4 β€” Owner, Event, Date, Instructor propagate automatically from RG to all child resources (-TagsToInherit changes the list)
  • All inputs are parameters: -SubscriptionId, and -EventName to target the student groups New-WorkshopEnvironment.ps1 tagged for that event (or -ResourceGroupPrefix for groups made another way).
  • Always preview first: ./scripts/admin/Set-LabPolicy.ps1 -SubscriptionId <subscription-id> -EventName MyEvent -WhatIf
  • Idempotent β€” a re-run converges existing assignments.

πŸ”— Key references

Topic Link
Azure Verified Modules (AVM) index https://aka.ms/avm
AVM module source and docs https://github.com/Azure/bicep-registry-modules
Bicep documentation https://learn.microsoft.com/azure/azure-resource-manager/bicep/
Bicep parameter files (.bicepparam) https://learn.microsoft.com/azure/azure-resource-manager/bicep/parameter-files
GitHub Actions OIDC to Azure https://learn.microsoft.com/azure/developer/github/connect-from-azure-openid-connect
azure/login action https://github.com/Azure/login
Hub-spoke network topology https://learn.microsoft.com/azure/architecture/networking/architecture/hub-spoke
Azure Firewall DNAT https://learn.microsoft.com/azure/firewall/tutorial-firewall-dnat
Container Apps https://learn.microsoft.com/azure/container-apps/
Private endpoints https://learn.microsoft.com/azure/private-link/private-endpoint-overview
SQL failover groups https://learn.microsoft.com/azure/azure-sql/database/failover-group-sql-db
Azure Front Door https://learn.microsoft.com/azure/frontdoor/
Azure pricing calculator https://azure.microsoft.com/pricing/calculator/



GitHub feature spotlight Β· Pinned versions and automated updates

You just used it: every Azure Verified Module in these templates is pinned to an exact version β€” avm/res/network/virtual-network:0.9.0, never :latest. Your deploy today and the same deploy next month produce identical infrastructure. Find it: any br/public:avm/... line in a main.bicep. The version is the text after the final colon. Beyond the lab: pinning makes builds reproducible; Dependabot then proposes version bumps as pull requests, so upgrades become a reviewed decision instead of a surprise. Docs β†’