diff --git a/.devcontainer/03-azure-01-04-ai-07-fraud-intelligence/devcontainer.json b/.devcontainer/03-azure-01-04-ai-07-fraud-intelligence/devcontainer.json new file mode 100644 index 000000000..67ccf7a27 --- /dev/null +++ b/.devcontainer/03-azure-01-04-ai-07-fraud-intelligence/devcontainer.json @@ -0,0 +1,72 @@ +{ + // Fraud Intelligence Hack — Codespaces / Dev Container + // Python agents + Microsoft Agent Framework orchestration + Azure tooling. + "name": "Azure / AI / Fraud Intelligence", + "image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm", + + "features": { + "ghcr.io/devcontainers/features/azure-cli:1": { + "version": "latest", + "installBicep": true + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "version": "latest", + "moby": true + }, + "ghcr.io/devcontainers/features/github-cli:1": { + "version": "latest" + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "lts" + }, + "ghcr.io/devcontainers/features/powershell:1": { + "version": "latest" + } + }, + + "customizations": { + "vscode": { + "extensions": [ + // Python + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.debugpy", + "ms-toolsai.jupyter", + // Azure / infra + "ms-azuretools.vscode-docker", + "ms-azuretools.vscode-bicep", + "ms-azuretools.vscode-azurefunctions", + "ms-vscode.powershell", + // AI / Foundry tooling + "ms-windows-ai-studio.windows-ai-studio", + // GitHub Copilot + "GitHub.copilot", + "GitHub.copilot-chat" + ], + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python" + } + } + }, + + // Fraud Alert API / DevUI (8080), Functions (7071), hosted agent (8088), Jupyter (8888) + "forwardPorts": [7071, 8080, 8088, 8888], + "portsAttributes": { + "7071": { "label": "Financial Evidence MCP" }, + "8080": { "label": "Fraud Alert API / DevUI" }, + "8088": { "label": "Foundry Hosted Agent" }, + "8888": { "label": "Jupyter" } + }, + + "postAttachCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/welcome.sh", + + "remoteUser": "vscode", + + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence", + + "remoteEnv": { + "hackFolder": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence", + "walkthroughHome": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough", + "challengesHome": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges" + } +} diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/devcontainer.json b/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/devcontainer.json index 2f47afa8e..67ccf7a27 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/devcontainer.json +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ { // Fraud Intelligence Hack — Codespaces / Dev Container // Python agents + Microsoft Agent Framework orchestration + Azure tooling. - "name": "Fraud Intelligence Hack", + "name": "Azure / AI / Fraud Intelligence", "image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm", "features": { @@ -58,7 +58,15 @@ "8888": { "label": "Jupyter" } }, - "postCreateCommand": "bash .devcontainer/post-create.sh", + "postAttachCommand": "bash /workspaces/${localWorkspaceFolderBasename}/.devcontainer/welcome.sh", - "remoteUser": "vscode" + "remoteUser": "vscode", + + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence", + + "remoteEnv": { + "hackFolder": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence", + "walkthroughHome": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough", + "challengesHome": "/workspaces/${localWorkspaceFolderBasename}/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges" + } } diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/post-create.sh b/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/post-create.sh deleted file mode 100644 index ebe515fdb..000000000 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/.devcontainer/post-create.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -az bicep install - -if ! command -v azd >/dev/null 2>&1; then - curl -fsSL https://aka.ms/install-azd.sh | bash -fi - -if ! azd ext list 2>/dev/null | grep -q 'microsoft.foundry'; then - azd ext install microsoft.foundry -fi - -if ! command -v func >/dev/null 2>&1; then - sudo npm install --global azure-functions-core-tools@4 --unsafe-perm=true -fi \ No newline at end of file diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/baseenv b/03-Azure/01-04-AI/07_Fraud_Intelligence/baseenv deleted file mode 100644 index 536c7a6f7..000000000 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/baseenv +++ /dev/null @@ -1,3 +0,0 @@ -rootHome=$(pwd) -walkthroughHome=$rootHome/walkthrough -challengesHome=$rootHome/challenges \ No newline at end of file diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-01.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-01.md index 05f03f98a..1ab3918b0 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-01.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-01.md @@ -16,7 +16,7 @@ Complete this setup with the credentials provided in your Hackbox. Use the assig ### 1. Sign in to Azure -Open the [Azure portal](https://portal.azure.com) and sign in with the credentials provided in your Hackbox. +Open the [Azure portal](https://portal.azure.com) and sign in with the credentials provided in your Hackbox (See the **Credentials** section at the top of this web page). When prompted to choose an account, select **Use another account** and enter the credentials provided. Do not use your personal or work account. @@ -36,7 +36,7 @@ Verify that you can access the resources used in the later challenges, including Open [GitHub](https://github.com) and sign in with the credentials provided in your Hackbox. -When prompted to choose an account, select **Use another account**. Do not use your personal or work account. +When prompted to choose an account, select **Use another account**. Do not use your personal or work account. ![Sign in to GitHub with another account](/challenges/images/github-login.png) @@ -46,7 +46,15 @@ Open the GitHub organization assigned to your lab account. ![GitHub organization selector](/challenges/images/github-organization.png) -Select the assigned organization, then open the `microhack` repository. Confirm that you can see the repository files and folders. +Select the assigned organization, then open the `microhack` repository. You need to fork the repository before you can create a Codespace. To fork the repository, click the **Fork** button in the top-right corner of the repository page and follow the prompts: + +![Create fork](/challenges/images/create-fork-1.png) + +Use a unique name for the repository name to avoid conflicts with other forks. For example, you can append your lab username to the repository name (e.g., `microhack-labuser-0001`): + +![Fork repository with unique name](/challenges/images/create-fork-2.png) + +Finally, you should see your forked repository with the unique name you provided and all files and folders from the original repository: ![Files and folders in the GitHub repository](/challenges/images/github-repository.png) @@ -56,27 +64,34 @@ From the repository page, select **Code**, then open the **Codespaces** tab. Sel ![Create a GitHub Codespace with options](/challenges/images/github-codespaces.png) -For **Dev container configuration**, select **Azure / AI / Fraud Intelligence**, then select **Create codespace**. +For **Dev container configuration**, select **Azure / AI / Fraud Intelligence**, then select **Create codespace**: + +![Select Azure / AI / Fraud Intelligence dev container configuration](/challenges/images/select-dev-container.png) GitHub opens the Codespace in a new browser tab. Wait for the container setup to finish, then confirm that the repository files are visible in the Explorer and that the integrated terminal opens without errors. -Open a terminal in the Codespace (Terminal > New Terminal) and run the following command to verify that Azure CLI is installed: +You should have a terminal ready to use, otherwise open a terminal in the Codespace (Terminal > New Terminal). Then run the following command to verify that Azure CLI is installed: ```bash az --version ``` -Then sign in to Azure from the Codespace terminal: +Then sign in to Azure from the Codespace terminal and follow the link shown to authenticate with a web browser and the device code: ```bash az login ``` -Next, initialize a local environment file with the following commands: +First, create a `rg` environment variable with your Resource Group name provided in Hackbox: ```bash # init RG with your Resource Group name provided in Hackbox rg= +``` + +Next, initialize a local environment file with the following commands: + +```bash DEPLOYMENT=$(az deployment group list -g "$rg" \ --query "sort_by([?starts_with(name, 'mhh')], &properties.timestamp)[-1].name" \ -o tsv) @@ -99,7 +114,6 @@ chmod 600 hackenv echo "rg=$rg" >> hackenv cat hackenv source hackenv -source baseenv ``` ## 🚀 Go Further diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-03.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-03.md index 7c426b2fd..8343705de 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-03.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-03.md @@ -24,10 +24,9 @@ The assessment must remain grounded in retrieved policy. Missing or conflicting ## ✅ Tasks -Before starting, source `baseenv` and `hackenv` to load the environment variables used by this challenge. +Before starting, source `hackenv` to load the environment variables used by this challenge. ```bash -source baseenv source hackenv ``` diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-04.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-04.md index bec19086f..3c6305c95 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-04.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-04.md @@ -28,10 +28,9 @@ The orchestration owns sequencing, state transfer, failure handling, and the fin ## ✅ Tasks -Before starting, source `baseenv` and `hackenv` to load the environment variables used by this challenge. +Before starting, source `hackenv` to load the environment variables used by this challenge. ```bash -source baseenv source hackenv ``` diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-05.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-05.md index 17655b514..f14f45d90 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-05.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/challenge-05.md @@ -28,10 +28,9 @@ The Alert Manager Agent must treat the regulatory assessment as authoritative. I ## ✅ Tasks -Before starting, source `baseenv` and `hackenv` to load the environment variables used by this challenge. +Before starting, source `hackenv` to load the environment variables used by this challenge. ```bash -source baseenv source hackenv ``` diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/create-fork-1.png b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/create-fork-1.png new file mode 100644 index 000000000..b7b0c45b5 Binary files /dev/null and b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/create-fork-1.png differ diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/create-fork-2.png b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/create-fork-2.png new file mode 100644 index 000000000..2c44798c9 Binary files /dev/null and b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/create-fork-2.png differ diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-codespaces.png b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-codespaces.png index d7512516f..24ed14124 100644 Binary files a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-codespaces.png and b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-codespaces.png differ diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-repository.png b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-repository.png index f5dc26875..4e2e0895a 100644 Binary files a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-repository.png and b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/github-repository.png differ diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/select-dev-container.png b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/select-dev-container.png new file mode 100644 index 000000000..f4f42c373 Binary files /dev/null and b/03-Azure/01-04-AI/07_Fraud_Intelligence/challenges/images/select-dev-container.png differ diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-01/solution-01.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-01/solution-01.md index 186b6c9c5..82c729c89 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-01/solution-01.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-01/solution-01.md @@ -16,7 +16,7 @@ Complete this setup with the credentials provided in your Hackbox. Use the assig ### 1. Sign in to Azure -Open the [Azure portal](https://portal.azure.com) and sign in with the credentials provided in your Hackbox. +Open the [Azure portal](https://portal.azure.com) and sign in with the credentials provided in your Hackbox (See the **Credentials** section at the top of this web page). When prompted to choose an account, select **Use another account** and enter the credentials provided. Do not use your personal or work account. @@ -32,11 +32,11 @@ Open the resource group assigned to you and confirm that its resources have been Verify that you can access the resources used in the later challenges, including the Microsoft Foundry project, model deployments, Azure Cosmos DB account, and Application Insights resource. -### 2. Sign in to GitHub +## 2. Sign in to GitHub Open [GitHub](https://github.com) and sign in with the credentials provided in your Hackbox. -When prompted to choose an account, select **Use another account**. Do not use your personal or work account. +When prompted to choose an account, select **Use another account**. Do not use your personal or work account. ![Sign in to GitHub with another account](/challenges/images/github-login.png) @@ -46,7 +46,15 @@ Open the GitHub organization assigned to your lab account. ![GitHub organization selector](/challenges/images/github-organization.png) -Select the assigned organization, then open the `microhack` repository. Confirm that you can see the repository files and folders. +Select the assigned organization, then open the `microhack` repository. You need to fork the repository before you can create a Codespace. To fork the repository, click the **Fork** button in the top-right corner of the repository page and follow the prompts: + +![Create fork](/challenges/images/create-fork-1.png) + +Use a unique name for the repository name to avoid conflicts with other forks. For example, you can append your lab username to the repository name (e.g., `microhack-labuser-0001`): + +![Fork repository with unique name](/challenges/images/create-fork-2.png) + +Finally, you should see your forked repository with the unique name you provided and all files and folders from the original repository: ![Files and folders in the GitHub repository](/challenges/images/github-repository.png) @@ -56,27 +64,34 @@ From the repository page, select **Code**, then open the **Codespaces** tab. Sel ![Create a GitHub Codespace with options](/challenges/images/github-codespaces.png) -For **Dev container configuration**, select **Azure / AI / Fraud Intelligence**, then select **Create codespace**. +For **Dev container configuration**, select **Azure / AI / Fraud Intelligence**, then select **Create codespace**: + +![Select Azure / AI / Fraud Intelligence dev container configuration](/challenges/images/select-dev-container.png) GitHub opens the Codespace in a new browser tab. Wait for the container setup to finish, then confirm that the repository files are visible in the Explorer and that the integrated terminal opens without errors. -Open a terminal in the Codespace (Terminal > New Terminal) and run the following command to verify that Azure CLI is installed: +You should have a terminal ready to use, otherwise open a terminal in the Codespace (Terminal > New Terminal). Then run the following command to verify that Azure CLI is installed: ```bash az --version ``` -Then sign in to Azure from the Codespace terminal: +Then sign in to Azure from the Codespace terminal and follow the link shown to authenticate with a web browser and the device code: ```bash az login ``` -Next, initialize a local environment file with the following commands: +First, create a `rg` environment variable with your Resource Group name provided in Hackbox: ```bash # init RG with your Resource Group name provided in Hackbox rg= +``` + +Next, initialize a local environment file with the following commands: + +```bash DEPLOYMENT=$(az deployment group list -g "$rg" \ --query "sort_by([?starts_with(name, 'mhh')], &properties.timestamp)[-1].name" \ -o tsv) @@ -99,7 +114,6 @@ chmod 600 hackenv echo "rg=$rg" >> hackenv cat hackenv source hackenv -source baseenv ``` ## 🚀 Go Further diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-03/solution-03.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-03/solution-03.md index 99b8a09c5..dd7ec52e5 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-03/solution-03.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-03/solution-03.md @@ -24,10 +24,9 @@ The assessment must remain grounded in retrieved policy. Missing or conflicting ## ✅ Tasks -Before starting, source `baseenv` and `hackenv` to load the environment variables used by this challenge. +Before starting, source `hackenv` to load the environment variables used by this challenge. ```bash -source baseenv source hackenv ``` diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-04/solution-04.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-04/solution-04.md index 563365f87..dbc3c05eb 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-04/solution-04.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-04/solution-04.md @@ -28,10 +28,9 @@ The orchestration owns sequencing, state transfer, failure handling, and the fin ## ✅ Tasks -Before starting, source `baseenv` and `hackenv` to load the environment variables used by this challenge. +Before starting, source `hackenv` to load the environment variables used by this challenge. ```bash -source baseenv source hackenv ``` diff --git a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-05/solution-05.md b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-05/solution-05.md index 566215761..b236e7816 100644 --- a/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-05/solution-05.md +++ b/03-Azure/01-04-AI/07_Fraud_Intelligence/walkthrough/challenge-05/solution-05.md @@ -28,10 +28,9 @@ The Alert Manager Agent must treat the regulatory assessment as authoritative. I ## ✅ Tasks -Before starting, source `baseenv` and `hackenv` to load the environment variables used by this challenge. +Before starting, source `hackenv` to load the environment variables used by this challenge. ```bash -source baseenv source hackenv ```