From b20b06d87c0671198323b9b3701cefb858206ac8 Mon Sep 17 00:00:00 2001 From: Glejdis Shkembi Date: Mon, 17 Aug 2026 18:01:06 +0200 Subject: [PATCH] Move .env.example into src/ (04 Agentic CLM MicroHack) Move the env template from the microhack root to src/.env.example and update every doc and code reference (challenges 01/02, solution-01, config.py, write_env.py, upload_corpus_to_sharepoint.py) to the new path. The runtime .env still lives at the lab root, so the template copy becomes 'cp src/.env.example .env'. Mirrors the same change already on glejdis/microhack-aiagents main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1fc16431-2e57-4bc0-a80c-211e5235e8f8 --- .../challenges/challenge-01.md | 4 ++-- .../challenges/challenge-02.md | 2 +- .../{ => src}/.env.example | 0 .../src/clm_common/config.py | 2 +- .../src/scripts/upload_corpus_to_sharepoint.py | 2 +- .../src/scripts/write_env.py | 2 +- .../walkthrough/challenge-01/solution-01.md | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) rename 03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/{ => src}/.env.example (100%) diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-01.md b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-01.md index 40efa5e31..f55209e12 100644 --- a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-01.md +++ b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-01.md @@ -201,7 +201,7 @@ point your `.env` at them using the values on your **lab dashboard**. **Step 3a — create your `.env`** from the template (Codespace terminal, at the repo root): ```bash -cp .env.example .env +cp src/.env.example .env ``` **Step 3b — copy your dashboard values into `.env`.** Open `.env` in the Codespace editor and fill in @@ -219,7 +219,7 @@ the values shown on your lab dashboard: > [!TIP] > The model names plus `AZURE_SEARCH_INDEX` (`clm-corpus`) and `AZURE_SEARCH_CONNECTION_NAME` -> (`clm-search`) already have the right defaults in `.env.example`, so at minimum you only need to +> (`clm-search`) already have the right defaults in `src/.env.example`, so at minimum you only need to > paste the two **endpoints** and the **App Insights connection string**. Paste the model names too if > your dashboard shows different values. diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-02.md b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-02.md index e8bd020d9..f59cbf351 100644 --- a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-02.md +++ b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/challenges/challenge-02.md @@ -390,7 +390,7 @@ You're done when: | `get_contract_status` says "not found" | Use a known id (`CT-4821`, `CT-3390`, `CT-5102`, `CT-2765`, `CT-6033`) — the error message lists them. | | `400 … Access denied` during retrieval or setup | The Foundry account/project identities need Search reader/contributor roles, and the Search identity needs Cognitive Services User on the Foundry account. Re-run provisioning and allow time for RBAC propagation. | | `429 rate_limit_exceeded` on `gpt-5.4` mid-demo | Deployment throughput throttling. The demo now retries with exponential backoff and isolates each prompt (`run_agent_with_retry`), so it rides through and continues. If it persists, raise the deployment capacity or space out prompts. | -| `Missing required environment variable 'AZURE_AI_PROJECT_ENDPOINT'` | Re-run Challenge 1's deploy (which writes `.env`) or copy `.env.example` → `.env` and fill it in. | +| `Missing required environment variable 'AZURE_AI_PROJECT_ENDPOINT'` | Re-run Challenge 1's deploy (which writes `.env`) or copy `src/.env.example` → `.env` and fill it in. | ## 🔗 How this fits diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/.env.example b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/.env.example similarity index 100% rename from 03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/.env.example rename to 03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/.env.example diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/clm_common/config.py b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/clm_common/config.py index 41e731f43..f06bb0347 100644 --- a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/clm_common/config.py +++ b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/clm_common/config.py @@ -33,7 +33,7 @@ def _get(name: str, default: str | None = None, required: bool = False) -> str | if required and not value: raise RuntimeError( f"Missing required environment variable '{name}'. " - f"Run Challenge 1's deploy script or copy .env.example → .env and fill it in." + f"Run Challenge 1's deploy script or copy src/.env.example → .env and fill it in." ) return value diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/upload_corpus_to_sharepoint.py b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/upload_corpus_to_sharepoint.py index 1e5fd6c5f..8fd3de942 100644 --- a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/upload_corpus_to_sharepoint.py +++ b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/upload_corpus_to_sharepoint.py @@ -81,7 +81,7 @@ def get_token() -> str: _fail( "Missing SharePoint settings: " + ", ".join(missing) - + ".\n Set them in .env (see .env.example / challenge-0 README)." + + ".\n Set them in .env (see src/.env.example / challenge-0 README)." ) from azure.identity import ClientSecretCredential diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/write_env.py b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/write_env.py index 93ec699a7..23179dd18 100644 --- a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/write_env.py +++ b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/src/scripts/write_env.py @@ -22,7 +22,7 @@ REPO_ROOT = Path(__file__).resolve().parents[2] ENV_PATH = REPO_ROOT / ".env" -# Keys sourced from Bicep outputs (via azd env). Fall back to the .env.example +# Keys sourced from Bicep outputs (via azd env). Fall back to the src/.env.example # defaults for the constant-valued ones if an output is missing. DEFAULTS = { "MODEL_ORCHESTRATOR": "gpt-5.4", diff --git a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/walkthrough/challenge-01/solution-01.md b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/walkthrough/challenge-01/solution-01.md index 1c2cd5bae..302fa5d45 100644 --- a/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/walkthrough/challenge-01/solution-01.md +++ b/03-Azure/01-04-AI/04_Agentic_Contract_Lifecycle_Management/walkthrough/challenge-01/solution-01.md @@ -46,7 +46,7 @@ az account set --subscription "" ### Task 3 · Connect to your provisioned resources **MicroHack event — resources are already provisioned; you don't deploy.** Point `.env` at the values on your **lab dashboard**: ```bash -cp .env.example .env +cp src/.env.example .env # then paste the dashboard values into .env (the two endpoints + the App Insights connection string) ``` @@ -57,7 +57,7 @@ cp .env.example .env | **AppInsightsConnectionString** | `APPLICATIONINSIGHTS_CONNECTION_STRING` | | **ModelOrchestrator / Drafting / ClauseRisk / Renewal** | `MODEL_ORCHESTRATOR` / `MODEL_DRAFTING` / `MODEL_CLAUSE_RISK` / `MODEL_RENEWAL` | -The model names + `AZURE_SEARCH_INDEX` (`clm-corpus`) / `AZURE_SEARCH_CONNECTION_NAME` (`clm-search`) already default in `.env.example`, so at minimum paste the two **endpoints** + the **App Insights** string. Leave `SHAREPOINT_*` and the Challenge 5 `MICROSOFT_APP_*` / `TEAMS_*` blank for now. +The model names + `AZURE_SEARCH_INDEX` (`clm-corpus`) / `AZURE_SEARCH_CONNECTION_NAME` (`clm-search`) already default in `src/.env.example`, so at minimum paste the two **endpoints** + the **App Insights** string. Leave `SHAREPOINT_*` and the Challenge 5 `MICROSOFT_APP_*` / `TEAMS_*` blank for now.
Self-hosting? One azd up provisions everything and writes .env for you