Skip to content

Add GitHub Codespaces devcontainer configuration for Starter Lab#153

Open
hoisjp wants to merge 1 commit into
microsoft:mainfrom
hoisjp:feature/add-devcontainer
Open

Add GitHub Codespaces devcontainer configuration for Starter Lab#153
hoisjp wants to merge 1 commit into
microsoft:mainfrom
hoisjp:feature/add-devcontainer

Conversation

@hoisjp
Copy link
Copy Markdown

@hoisjp hoisjp commented May 8, 2026

Summary

This PR adds a .devcontainer configuration to enable GitHub Codespaces support for the Starter Lab (labs/starter-lab/), providing a zero-setup development environment for lab participants.

Files added

  • .devcontainer/devcontainer.json — Dev container configuration
  • .devcontainer/post-create.sh — One-time setup script (runs on container creation)
  • .devcontainer/post-start.sh — Welcome message with login instructions (runs on each terminal open)

Dev Container Features

Feature Purpose
Azure CLI (with Bicep) Azure resource management and infrastructure deployment
Azure Developer CLI (azd) azd up / azd down --purge for deploy and teardown
GitHub CLI Scenario 3: issue triage

VS Code extensions

  • ms-azuretools.vscode-bicep
  • ms-azuretools.azure-dev
  • ms-azuretools.vscode-azure-github-copilot
  • ms-vscode.azurecli
  • ms-python.python
  • redhat.vscode-yaml
  • github.copilot-chat

Design decisions

  • Base image: mcr.microsoft.com/devcontainers/base:ubuntu — Dev Container-compatible base; system Python 3 from Ubuntu 24.04 is sufficient (no Python Feature needed, avoiding long build times)
  • python3-yaml via apt: Pre-compiled binary instead of pip install pyyaml to avoid C extension build time
  • No Docker-in-Docker: The Starter Lab uses ACR Tasks for container builds, so DinD is not required
  • Host requirements: 2-core / 4 GB — minimal configuration sufficient for Bicep deployment and shell scripts, minimizing Codespaces billing
  • Azure credential mount: ~/.azure bind mount configured for local Dev Container reuse (ignored in Codespaces)

Quick start (after opening in Codespaces)

az login --use-device-code
cd labs/starter-lab
bash scripts/setup.sh

This PR adds a `.devcontainer` configuration to enable GitHub Codespaces
support for the Starter Lab (`labs/starter-lab/`).

## What's included

- `.devcontainer/devcontainer.json`: Dev container configuration with the
  following Dev Container Features:
  - Azure CLI (with Bicep)
  - Azure Developer CLI (azd)
  - GitHub CLI (for Scenario 3: issue triage)
- `.devcontainer/post-create.sh`: Installs `python3-yaml` and `jq` via apt
  (pre-compiled binaries, no pip build time)
- `.devcontainer/post-start.sh`: Displays a brief welcome message with
  Azure login instructions on each terminal open

## VS Code extensions installed

- `ms-azuretools.vscode-bicep`
- `ms-azuretools.azure-dev`
- `ms-azuretools.vscode-azure-github-copilot`
- `ms-vscode.azurecli`
- `ms-python.python`
- `redhat.vscode-yaml`
- `github.copilot-chat`

## Design decisions

- Uses `mcr.microsoft.com/devcontainers/base:ubuntu` as the base image;
  system Python 3 is sufficient (no Python Feature needed)
- Docker-in-Docker is not required since the Starter Lab uses ACR Tasks
- Host requirements set to 2-core / 4 GB to minimize Codespaces billing
- Azure credential mount configured for local Dev Container reuse
@hoisjp
Copy link
Copy Markdown
Author

hoisjp commented May 8, 2026

@microsoft-github-policy-service agree company="Microsoft"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant