From 3aeffc45fc2de40574a82d356b646bc604a9875f Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Wed, 13 May 2026 20:53:32 +0200 Subject: [PATCH 1/2] feat(codespace): add Azure CLI devcontainer + az login guide Students opening the assignment in GitHub Codespaces now get the Azure CLI pre-installed via the devcontainer features spec. AZURE_LOGIN.md provides a step-by-step device-code login walkthrough and troubleshooting tips for Task 3 (Blob Storage upload), removing the dependency on Week 1 local setup. Co-Authored-By: Claude Sonnet 4.6 --- .devcontainer/devcontainer.json | 32 +++++++++++++------- AZURE_LOGIN.md | 53 +++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 AZURE_LOGIN.md diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5f7cd57..cdc51de 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,13 +1,25 @@ { - "name": "HYF Week 2 Assignment", - "image": "mcr.microsoft.com/devcontainers/python:3.11", - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance" - ] + "name": "Week 2 Assignment", + "image": "mcr.microsoft.com/devcontainers/python:3.11", + "features": { + "ghcr.io/devcontainers/features/azure-cli:1": {} + }, + "postCreateCommand": "pip install -r task-1/requirements.txt", + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.debugpy", + "charliermarsh.ruff" + ], + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true } - }, - "postCreateCommand": "python3 -m pip install -r task-1/requirements.txt && echo '✅ HYF Week 2 Assignment Codespace ready. Run the auto-grader locally with: bash .hyf/test.sh && cat .hyf/score.json'" + } + } + } } diff --git a/AZURE_LOGIN.md b/AZURE_LOGIN.md new file mode 100644 index 0000000..1f898d0 --- /dev/null +++ b/AZURE_LOGIN.md @@ -0,0 +1,53 @@ +# Logging in to Azure + +The Week 2 assignment requires access to the HackYourFuture Azure tenant to upload files to Azure Blob Storage (Task 3). + +## In GitHub Codespaces + +The Azure CLI is pre-installed in this Codespace. You only need to authenticate. + +Run the following command in the Codespace terminal: + +```bash +az login --use-device-code +``` + +You will see output like: + +```text +To sign in, use a web browser to open the page https://microsoft.com/devicelogin +and enter the code XXXXXXXX to authenticate. +``` + +1. Open [microsoft.com/devicelogin](https://microsoft.com/devicelogin) in your browser. +2. Enter the code shown in the terminal. +3. Sign in with the HackYourFuture credentials your teacher provided (format: `firstname.lastname@hackyourfuture.net` or similar). +4. Return to the Codespace terminal. You should see your account details printed. + +Verify the login succeeded: + +```bash +az account show --query "{user:user.name, subscription:name, tenant:homeTenantId}" --output table +``` + +The `user` field should show your HackYourFuture account email. + +## On your local machine + +If you are working locally and the Azure CLI is already installed from Week 1, run: + +```bash +az login +``` + +This opens a browser window for you to sign in. After signing in, return to the terminal and verify with the command above. + +If `az` is not installed, follow the [official installation guide](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) for your OS, then run `az login`. + +## Troubleshooting + +**"The subscription is not in the HackYourFuture tenant"**: You are logged in with a personal or work account. Run `az logout`, then `az login --use-device-code` again and use the HYF credentials. + +**"Authorization failed" on storage commands**: Your account may not have the `Storage Blob Data Contributor` role on `sthyfstudentsdemo`. Contact your teacher. + +**Code expired**: The device login code is valid for 15 minutes. If it expires, re-run `az login --use-device-code` to get a new one. From a03531b0544676bce7238011f935a0d63b91a8f4 Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Wed, 13 May 2026 21:23:33 +0200 Subject: [PATCH 2/2] fix(codespace): use python3 -m pip and link AZURE_LOGIN.md from README - Match python3 -m pip convention used in README and .hyf/test.sh - Add AZURE_LOGIN.md reference to Task 3 row in README so students landing directly in the repo can find the login instructions --- .devcontainer/devcontainer.json | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cdc51de..856d402 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,7 @@ "features": { "ghcr.io/devcontainers/features/azure-cli:1": {} }, - "postCreateCommand": "pip install -r task-1/requirements.txt", + "postCreateCommand": "python3 -m pip install -r task-1/requirements.txt", "customizations": { "vscode": { "extensions": [ diff --git a/README.md b/README.md index be26bf7..0e73ad8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ cohort copies. |---|---|---|---| | **Task 1** — Cleaner Pipeline | `task-1/` | 60 | A modular Python pipeline with `config.py` (env-var loading), `models.py` (`Transaction` dataclass with `__post_init__` validation), `transforms.py` (4+ pure composable functions, no mutation), `pipeline.py` (orchestrator), and `tests/test_transforms.py` (4+ pytest tests). Reads `data/messy_sales.csv`, writes `output/clean_sales.csv`. | | **Task 2** — AI Debug Report | `task-2/` | 20 | Document one debugging session where you used an LLM to fix a bug. Fill in the four sections of `AI_DEBUG.md`. | -| **Task 3** — Azure Blob Upload | `task-3/` | 20 | Upload `task-1/output/clean_sales.csv` to a private Blob container in the HYF Azure storage account using the portal's Storage Browser. Save your screenshot as `task-3/assets/azure_blob_week2.png` (`.jpg`/`.jpeg` also accepted) and the blob URL in `task-3/assets/blob_url.txt`. | +| **Task 3** — Azure Blob Upload | `task-3/` | 20 | Upload `task-1/output/clean_sales.csv` to a private Blob container in the HYF Azure storage account using the portal's Storage Browser. Save your screenshot as `task-3/assets/azure_blob_week2.png` (`.jpg`/`.jpeg` also accepted) and the blob URL in `task-3/assets/blob_url.txt`. Working in Codespaces? See [AZURE_LOGIN.md](AZURE_LOGIN.md) to authenticate first. | Total: 100 · Passing: 60.