Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "Azure SRE Agent Lab",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",

// --- Dev Container Features ---
"features": {
// Azure CLI + Bicep
"ghcr.io/devcontainers/features/azure-cli:1": {
"installBicep": true,
"version": "latest"
},
// Azure Developer CLI (azd)
"ghcr.io/azure/azure-dev/azd:latest": {},
// Python: system python3 from base image is sufficient (pyyaml via apt)
// GitHub CLI (Scenario 3: issue triage)
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
}
},

// --- VS Code Extensions ---
"customizations": {
"vscode": {
"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"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},

// --- Lifecycle Hooks ---
"postCreateCommand": "bash .devcontainer/post-create.sh",
"postStartCommand": "bash .devcontainer/post-start.sh",

// --- Azure credentials mount (for local Dev Container use) ---
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.azure,target=/home/vscode/.azure,type=bind,consistency=cached"
],

// --- Recommended Codespaces machine type ---
"hostRequirements": {
"cpus": 2,
"memory": "4gb"
},

"remoteUser": "vscode"
}
13 changes: 13 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# =============================================================================
# Post-Create Script for Azure SRE Agent Lab Dev Container
# Runs once when the container is first created.
# =============================================================================
set -e

echo "Setting up Azure SRE Agent Lab environment..."

# Install system packages (python3-yaml is pre-compiled, much faster than pip)
sudo apt-get update && sudo apt-get install -y --no-install-recommends python3-yaml jq

echo "Setup complete."
21 changes: 21 additions & 0 deletions .devcontainer/post-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# =============================================================================
# Post-Start Script — runs each time the container starts.
# =============================================================================

echo ""
echo "========================================"
echo " Azure SRE Agent Lab"
echo "========================================"
echo " Docs: https://aka.ms/sreagent/lab"
echo "========================================"
echo ""

# Check Azure login status
if az account show &>/dev/null; then
ACCOUNT=$(az account show --query 'name' -o tsv)
echo "Azure: Logged in ($ACCOUNT)"
else
echo "Azure: Not logged in. Run 'az login --use-device-code' to authenticate."
fi
echo ""