From e65df452d2cf2293fe496d8248be6df118020fac Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Mon, 6 Nov 2023 22:14:39 -0500 Subject: [PATCH 1/9] Added OpenAI Fundamentals to WTH home page AND linked to it from the archived "002-IntroToAI" hack --- 002-IntroToAzureAI/README.md | 2 ++ README.md | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/002-IntroToAzureAI/README.md b/002-IntroToAzureAI/README.md index b89057686d..614976fc20 100644 --- a/002-IntroToAzureAI/README.md +++ b/002-IntroToAzureAI/README.md @@ -2,6 +2,8 @@ **NOTE: This hack has been marked as "archived" since one of the data sources used by students is no longer available.** +**NOTE:** Please see our NEW hack on [Azure OpenAI Fundamentals](../066-OpenAIFundamentals/README.md) which should replace this hack. + If you would like to update this hack so we can "un-archive" it, please submit a proposal to the What The Hack team as per our [WTH Contribution Guide](https://aka.ms/wthcontribute). We welcome contributions and can provide you more details on what would be needed to update it. ## Introduction diff --git a/README.md b/README.md index 0a577cbc72..62106bad8c 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Here is the current list of What The Hack hackathons available in this repositor - [Azure Chaos Studio for AKS](/055-ChaosStudio4AKS/README.md) ## Data & AI +- [Azure OpenAI Fundamentals](/066-OpenAIFundamentals/README.md) - [Cosmic Troubleshooting](/056-CosmicTroubleshooting/README.md) - [Data Governance with Microsoft Purview](/051-MicrosoftPurview/README.md) - [SQL Modernization and Migration](/043-SQLModernization/README.md) @@ -120,8 +121,6 @@ Here is the current list of What The Hack hackathons available in this repositor - [Bronze/Silver/Gold Using Synapse & Databricks](/060-SynapseAndDatabricks/README.md) - [Conversational AI](/030-ConversationalAI/README.md) - [Databricks/Intro to ML](/008-DatabricksIntroML/README.md) -- [Intro To Azure AI](/002-IntroToAzureAI/README.md) - ARCHIVED -- [Driving Miss Data](/003-DrivingMissData/README.md) - ARCHIVED ## Microsoft Teams Platform - [Microsoft Teams: Make It Real](/034-MicrosoftTeams-MakeItReal/README.md) @@ -151,7 +150,7 @@ Here is the current list of What The Hack hackathons available in this repositor These hacks have been archived due to obsolescence or dependencies on sample code or data that is no longer available. If you are interested in updating these hacks, [contributions are welcome](CONTRIBUTING.md)! Please consider contributing to keep What The Hack up to date. -- [Intro To Azure AI](/002-IntroToAzureAI/README.md) +- [Intro To Azure AI](/002-IntroToAzureAI/README.md) - Be sure to see our NEW hack on [Azure OpenAI Fundamentals](/066-OpenAIFundamentals/README.md) - [Driving Miss Data](/003-DrivingMissData/README.md) # License From b83d74bfab1dad3ec1a288feff000b1e1c38ff32 Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Mon, 6 Nov 2023 22:22:07 -0500 Subject: [PATCH 2/9] added whitelist file for 002 --- 002-IntroToAzureAI/.wordlist.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 002-IntroToAzureAI/.wordlist.txt diff --git a/002-IntroToAzureAI/.wordlist.txt b/002-IntroToAzureAI/.wordlist.txt new file mode 100644 index 0000000000..9e219c4f3f --- /dev/null +++ b/002-IntroToAzureAI/.wordlist.txt @@ -0,0 +1,5 @@ +Edell +IntelligentKiosk +ServiceHelpers +botframework +customvision \ No newline at end of file From 67fd4b0c4b15e01fe060e1ede341f6147c533e8a Mon Sep 17 00:00:00 2001 From: "Peter C. Laudati" Date: Wed, 10 Apr 2024 23:27:08 -0400 Subject: [PATCH 3/9] Update README.md added link to 069 to the homepage --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 62106bad8c..3c54302e63 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,7 @@ Here is the current list of What The Hack hackathons available in this repositor ## Data & AI - [Azure OpenAI Fundamentals](/066-OpenAIFundamentals/README.md) +- [Fabric Real-time Analytics](/069-FabricRealTimeAnalytics/README.md) - [Cosmic Troubleshooting](/056-CosmicTroubleshooting/README.md) - [Data Governance with Microsoft Purview](/051-MicrosoftPurview/README.md) - [SQL Modernization and Migration](/043-SQLModernization/README.md) From c66b443d6e8ac09a6bffa63051f2a49c3e305d8f Mon Sep 17 00:00:00 2001 From: "Peter C. Laudati" Date: Sun, 12 May 2024 22:39:15 -0400 Subject: [PATCH 4/9] Update spellcheck.yml Testing md_in_html extension for pyseplling --- .github/workflows/spell-check/spellcheck.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/spell-check/spellcheck.yml b/.github/workflows/spell-check/spellcheck.yml index bb80ac62a8..354cf7553e 100644 --- a/.github/workflows/spell-check/spellcheck.yml +++ b/.github/workflows/spell-check/spellcheck.yml @@ -14,6 +14,7 @@ matrix: - pyspelling.filters.markdown: markdown_extensions: - pymdownx.superfences + - md_in_html - pyspelling.filters.html: comments: false ignores: From a2c9fbcc233d90194f8121414b94f434df5e7f09 Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Sun, 3 Aug 2025 22:57:25 -0400 Subject: [PATCH 5/9] added top-level devcontainer files for 068 AI Apps hack --- .devcontainer/068-AzureOpenAIApps/Dockerfile | 19 +++++++ .../068-AzureOpenAIApps/devcontainer.json | 55 +++++++++++++++++++ .../068-AzureOpenAIApps/postAttachCommands.sh | 25 +++++++++ 3 files changed, 99 insertions(+) create mode 100644 .devcontainer/068-AzureOpenAIApps/Dockerfile create mode 100644 .devcontainer/068-AzureOpenAIApps/devcontainer.json create mode 100755 .devcontainer/068-AzureOpenAIApps/postAttachCommands.sh diff --git a/.devcontainer/068-AzureOpenAIApps/Dockerfile b/.devcontainer/068-AzureOpenAIApps/Dockerfile new file mode 100644 index 0000000000..2dddc78bba --- /dev/null +++ b/.devcontainer/068-AzureOpenAIApps/Dockerfile @@ -0,0 +1,19 @@ +# Use the official Microsoft Python Dev Container image +FROM mcr.microsoft.com/devcontainers/python:3.11 + +# Install any additional dependencies +RUN apt-get update && apt-get install -y \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +# Install Azure CLI and Bicep +RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \ + az bicep install + +# Set the working directory +WORKDIR /workspace + +# Copy the current directory contents into the container +COPY . /workspace + +# Install Python dependencies if requirements.txt exists +RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt; fi \ No newline at end of file diff --git a/.devcontainer/068-AzureOpenAIApps/devcontainer.json b/.devcontainer/068-AzureOpenAIApps/devcontainer.json new file mode 100644 index 0000000000..c7f7e371b5 --- /dev/null +++ b/.devcontainer/068-AzureOpenAIApps/devcontainer.json @@ -0,0 +1,55 @@ +{ + "name": "What The Hack AI Apps", + "build": { + "dockerfile": "Dockerfile", + "context": "..", + "options": [ + "--platform=linux/amd64" + ] + }, + "workspaceFolder": "/workspace/068-AzureOpenAIApps/Student/Resources", + "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", + "onCreateCommand": "npm install -g @angular/cli azure-functions-core-tools@4", + "postAttachCommand": "bash .devcontainer/postAttachCommands.sh", + "features": { + "ghcr.io/devcontainers/features/azure-cli:1": { + "installBicep": false + }, + "ghcr.io/devcontainers/features/node:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "codespaces": { + "openFiles": [] + }, + "vscode": { + "extensions": [ + "ms-dotnettools.vscode-dotnet-runtime", + "ms-dotnettools.csdevkit", + "ms-dotnettools.csharp", + "ms-azuretools.vscode-azurefunctions", + "ms-vscode.vscode-typescript-next", + "ms-vscode.azure-account", + "ms-azuretools.vscode-azureresourcegroups", + "humao.rest-client", + "ms-azuretools.vscode-bicep", + "adamraichu.pdf-viewer" + ] + } + }, + "hostRequirements": { + "cpus": 2 + }, + "forwardPorts": [ + 7072, + 4200 // Added port 4200 + ], + "portsAttributes": { + "7072": { + "label": "backend" + }, + "4200": { // Added attributes for port 4200 + "label": "frontend" + } + } +} \ No newline at end of file diff --git a/.devcontainer/068-AzureOpenAIApps/postAttachCommands.sh b/.devcontainer/068-AzureOpenAIApps/postAttachCommands.sh new file mode 100755 index 0000000000..0cca741185 --- /dev/null +++ b/.devcontainer/068-AzureOpenAIApps/postAttachCommands.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Log some info we might need to troubleshoot. +ls /workspaces > ~/postAttachCommands.log +env >> ~/postAttachCommands.log + +# Retrieve the Codespace name if not already set. +if [ -z "$CODESPACE_NAME" ]; then + CODESPACE_NAME=$(gh codespace list --json name --jq '.[0].name') +fi + +# Change the backend and frontend port visibility to public... +gh codespace ports -c $CODESPACE_NAME >> ~/postAttachCommands.log +gh codespace ports visibility 7072:public -c $CODESPACE_NAME +gh codespace ports visibility 4200:public -c $CODESPACE_NAME +gh codespace ports -c $CODESPACE_NAME >> ~/postAttachCommands.log + +# Update the backend URL in the environment.ts file. +BACKEND_ADDRESS=$(gh codespace ports -c $CODESPACE_NAME --json label,browseUrl | jq -r '.[] | select(.label == "backend").browseUrl') +sed -i 's|http://localhost:7072|'$BACKEND_ADDRESS'|g' $CODESPACE_VSCODE_FOLDER/ContosoAIAppsFrontend/src/environments/environment.ts + +# Update the frontend URL in the environment.ts file (if needed). +FRONTEND_ADDRESS=$(gh codespace ports -c $CODESPACE_NAME --json label,browseUrl | jq -r '.[] | select(.label == "frontend").browseUrl') +sed -i 's|http://localhost:4200|'$FRONTEND_ADDRESS'|g' $CODESPACE_VSCODE_FOLDER/ContosoAIAppsFrontend/src/environments/environment.ts + From 9b110d029896637d601204f66cf4fc1e23e4ed9a Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Sun, 3 Aug 2025 22:59:28 -0400 Subject: [PATCH 6/9] Revert "added top-level devcontainer files for 068 AI Apps hack" This reverts commit a2c9fbcc233d90194f8121414b94f434df5e7f09. --- .devcontainer/068-AzureOpenAIApps/Dockerfile | 19 ------- .../068-AzureOpenAIApps/devcontainer.json | 55 ------------------- .../068-AzureOpenAIApps/postAttachCommands.sh | 25 --------- 3 files changed, 99 deletions(-) delete mode 100644 .devcontainer/068-AzureOpenAIApps/Dockerfile delete mode 100644 .devcontainer/068-AzureOpenAIApps/devcontainer.json delete mode 100755 .devcontainer/068-AzureOpenAIApps/postAttachCommands.sh diff --git a/.devcontainer/068-AzureOpenAIApps/Dockerfile b/.devcontainer/068-AzureOpenAIApps/Dockerfile deleted file mode 100644 index 2dddc78bba..0000000000 --- a/.devcontainer/068-AzureOpenAIApps/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Use the official Microsoft Python Dev Container image -FROM mcr.microsoft.com/devcontainers/python:3.11 - -# Install any additional dependencies -RUN apt-get update && apt-get install -y \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/* - -# Install Azure CLI and Bicep -RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \ - az bicep install - -# Set the working directory -WORKDIR /workspace - -# Copy the current directory contents into the container -COPY . /workspace - -# Install Python dependencies if requirements.txt exists -RUN if [ -f "requirements.txt" ]; then pip install -r requirements.txt; fi \ No newline at end of file diff --git a/.devcontainer/068-AzureOpenAIApps/devcontainer.json b/.devcontainer/068-AzureOpenAIApps/devcontainer.json deleted file mode 100644 index c7f7e371b5..0000000000 --- a/.devcontainer/068-AzureOpenAIApps/devcontainer.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "What The Hack AI Apps", - "build": { - "dockerfile": "Dockerfile", - "context": "..", - "options": [ - "--platform=linux/amd64" - ] - }, - "workspaceFolder": "/workspace/068-AzureOpenAIApps/Student/Resources", - "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", - "onCreateCommand": "npm install -g @angular/cli azure-functions-core-tools@4", - "postAttachCommand": "bash .devcontainer/postAttachCommands.sh", - "features": { - "ghcr.io/devcontainers/features/azure-cli:1": { - "installBicep": false - }, - "ghcr.io/devcontainers/features/node:1": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, - "customizations": { - "codespaces": { - "openFiles": [] - }, - "vscode": { - "extensions": [ - "ms-dotnettools.vscode-dotnet-runtime", - "ms-dotnettools.csdevkit", - "ms-dotnettools.csharp", - "ms-azuretools.vscode-azurefunctions", - "ms-vscode.vscode-typescript-next", - "ms-vscode.azure-account", - "ms-azuretools.vscode-azureresourcegroups", - "humao.rest-client", - "ms-azuretools.vscode-bicep", - "adamraichu.pdf-viewer" - ] - } - }, - "hostRequirements": { - "cpus": 2 - }, - "forwardPorts": [ - 7072, - 4200 // Added port 4200 - ], - "portsAttributes": { - "7072": { - "label": "backend" - }, - "4200": { // Added attributes for port 4200 - "label": "frontend" - } - } -} \ No newline at end of file diff --git a/.devcontainer/068-AzureOpenAIApps/postAttachCommands.sh b/.devcontainer/068-AzureOpenAIApps/postAttachCommands.sh deleted file mode 100755 index 0cca741185..0000000000 --- a/.devcontainer/068-AzureOpenAIApps/postAttachCommands.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# Log some info we might need to troubleshoot. -ls /workspaces > ~/postAttachCommands.log -env >> ~/postAttachCommands.log - -# Retrieve the Codespace name if not already set. -if [ -z "$CODESPACE_NAME" ]; then - CODESPACE_NAME=$(gh codespace list --json name --jq '.[0].name') -fi - -# Change the backend and frontend port visibility to public... -gh codespace ports -c $CODESPACE_NAME >> ~/postAttachCommands.log -gh codespace ports visibility 7072:public -c $CODESPACE_NAME -gh codespace ports visibility 4200:public -c $CODESPACE_NAME -gh codespace ports -c $CODESPACE_NAME >> ~/postAttachCommands.log - -# Update the backend URL in the environment.ts file. -BACKEND_ADDRESS=$(gh codespace ports -c $CODESPACE_NAME --json label,browseUrl | jq -r '.[] | select(.label == "backend").browseUrl') -sed -i 's|http://localhost:7072|'$BACKEND_ADDRESS'|g' $CODESPACE_VSCODE_FOLDER/ContosoAIAppsFrontend/src/environments/environment.ts - -# Update the frontend URL in the environment.ts file (if needed). -FRONTEND_ADDRESS=$(gh codespace ports -c $CODESPACE_NAME --json label,browseUrl | jq -r '.[] | select(.label == "frontend").browseUrl') -sed -i 's|http://localhost:4200|'$FRONTEND_ADDRESS'|g' $CODESPACE_VSCODE_FOLDER/ContosoAIAppsFrontend/src/environments/environment.ts - From 449375042c6165916a5d1994ebf0aba81298e65e Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Wed, 11 Nov 2026 21:48:16 -0500 Subject: [PATCH 7/9] Update Codespace setup instructions for GitHub Copilot Cost Optimization challenge --- .../Student/Challenge-00.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/076-GitHubCopilotCostOptimization/Student/Challenge-00.md b/076-GitHubCopilotCostOptimization/Student/Challenge-00.md index f99a5b6dd6..9becb35b8b 100644 --- a/076-GitHubCopilotCostOptimization/Student/Challenge-00.md +++ b/076-GitHubCopilotCostOptimization/Student/Challenge-00.md @@ -20,10 +20,12 @@ GitHub Codespaces provides a cloud-hosted Visual Studio Code environment that yo You need a GitHub account with access to GitHub Copilot and permission to use GitHub Codespaces. Codespaces compute and storage normally incur charges separately from GitHub Copilot, depending on your account's included usage and billing settings. All personal GitHub.com accounts include a monthly quota of free usage each month. GitHub will provide users in the Free plan 120 core hours, or 60 hours of run time on a 2 core codespace, plus 15 GB of storage each month. -1. Open the student Codespace creation link provided by your coach and sign in to GitHub. -2. Select the branch provided by your coach, if needed, and select `076-GitHubCopilotCostOptimization` as the **Dev container configuration**. -3. Select **Create codespace**. Once it opens, confirm that the student resources and GitHub Copilot extensions are available. -4. To return to your environment later, open [Your Codespaces](https://github.com/codespaces) and select your existing Codespace. +1. Open the Codespace for this hack: [GitHub Copilot Cost Optimization Codespace](https://aka.ms/wth/ghcpcostoptimization/codespace) +2. Sign in with your **personal** GitHub account. +3. Verify the `Dev container configuration` is set to the one for this hack, then click **Create Codespace**. +4. Wait for Visual Studio Code to load in your browser. The first launch takes approximately 3-5 minutes. Once it opens, confirm that the student resources and GitHub Copilot extensions are available. + +> **NOTE:** To return to your environment later, open [Your Codespaces](https://github.com/codespaces) and select your existing Codespace. ### Use a local workstation From f214bb23e96fcd95a4a4f05c30268f766afc0c4d Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Wed, 11 Nov 2026 21:52:34 -0500 Subject: [PATCH 8/9] Update instructions for local workstation setup in Challenge 00 --- 076-GitHubCopilotCostOptimization/Student/Challenge-00.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/076-GitHubCopilotCostOptimization/Student/Challenge-00.md b/076-GitHubCopilotCostOptimization/Student/Challenge-00.md index 9becb35b8b..60229b26eb 100644 --- a/076-GitHubCopilotCostOptimization/Student/Challenge-00.md +++ b/076-GitHubCopilotCostOptimization/Student/Challenge-00.md @@ -29,8 +29,9 @@ You need a GitHub account with access to GitHub Copilot and permission to use Gi ### Use a local workstation -1. Extract the Resources.zip file provided by your coach. -2. Open the extracted folder in Visual Studio Code and install or update the GitHub Copilot and GitHub Copilot Chat extensions. +1. [Download `Resources.zip`](https://aka.ms/wth/ghcpcostoptimization/resources), the student resources package. +2. Extract the Resources.zip file on your local workstation. +3. Open the extracted folder in Visual Studio Code and install or update the GitHub Copilot and GitHub Copilot Chat extensions. ### Set up GitHub Copilot From 373d4a862eaa45a9a4d417424f4a124d2253da54 Mon Sep 17 00:00:00 2001 From: Peter Laudati Date: Wed, 11 Nov 2026 22:02:46 -0500 Subject: [PATCH 9/9] Update README.md to clarify student resource usage with GitHub Codespaces --- 076-GitHubCopilotCostOptimization/Coach/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/076-GitHubCopilotCostOptimization/Coach/README.md b/076-GitHubCopilotCostOptimization/Coach/README.md index a45d595ad6..041eaac636 100644 --- a/076-GitHubCopilotCostOptimization/Coach/README.md +++ b/076-GitHubCopilotCostOptimization/Coach/README.md @@ -33,13 +33,13 @@ The guide covers the common preparation steps a coach needs to do before any Wha ### Student Resources -Before the hack, package the contents of the `/Student/Resources` folder into a Resources.zip file for students who work locally. +This hack uses GitHub Codespaces for all student resources. Students should use their personal GitHub accounts to access Codespaces which will provide a configured VS Code developer environment for them that runs in a browser, hosted in the cloud. -For students using GitHub Codespaces, prepare a student-facing repository containing the student resources and a dev container configuration. Verify that students can create a Codespace with the resources and the `076-GitHubCopilotCostOptimization` configuration, then provide the creation link and branch, if needed. Do not direct students to the What The Hack repository. +Alternatively, students may download the Student Resources package: [Resources.zip](https://aka.ms/wth/ghcpcostoptimization/resources) and use the DevContainer in it to load the pre-configured developer environment on their local workstation. -If publishing only the contents of `Student/Resources`, use its `.devcontainer/devcontainer.json` at the root of the student-facing repository. The repository-root configuration instead expects the `076-GitHubCopilotCostOptimization/Student/Resources` folder layout. +The links for the Codespace and Student Resources package are in Challenge 00 of the student guide. -The Student/Resources folder should contain: +The Codespace (and Student Resources package) contains: - **Starter codebase** with intentionally sub-optimal GitHub Copilot configuration: - Bloated `.github/copilot-instructions.md` (~1500 tokens) for Challenge 02