Thanks for taking the time to contribute. This repo is a growing collection of Microsoft Foundry labs - every fix, clarification, and new scenario helps.
- Never commit directly to
main. All changes go through a pull request from a feature branch. - Auth is
DefaultAzureCredential. Don't introduce admin keys in notebooks - use RBAC, except where APIM subscription keys are the documented path. - Notebooks must run top-to-bottom against the standard
.envafter the prerequisite labs have run.
This repo uses pre-commit to run a gitleaks secret scan on every commit. Set it up once per clone:
pip install pre-commit # or: uv tool install pre-commit
pre-commit installThe hook scans only your staged changes, so it blocks new secrets or environment
identifiers without re-flagging older content. It runs gitleaks via Docker, so
Docker must be available locally. Rules live in .gitleaks.toml:
the default gitleaks rule set (API keys, tokens, connection strings) plus a
repo-specific rule that catches Azure subscription IDs in URLs and resource paths.
To scan the whole working tree manually:
docker run --rm -v "$PWD:/repo" zricethezav/gitleaks:v8.30.1 dir /repoCommitted notebooks keep their cell outputs - they double as a "here is what success looks like" reference. Because outputs are committed, treat them as content:
- Restart and Run All before committing so outputs are coherent and in order.
- Scrub environment identifiers from outputs before committing. Replace real
Azure subscription IDs, resource/account/function-app names, internal hostnames,
and any keys or tokens with placeholders (
{subscription-id},{resource},{project}, and so on). The pre-commit hook catches subscription IDs and common secret shapes, but resource names and hostnames still need a manual pass. - Use the canonical all-zeros subscription ID (
00000000-0000-0000-0000-000000000000) for documented examples; it is allowlisted.
feature/<issue-number>-<brief-description>
bugfix/<issue-number>-<brief-description>
Branch from main. Open the PR back to main.
- Pick the next free lab number (current free slots: 17, 18, and anything above 20).
- Create a top-level directory
NN-short-name/. - Add an
NN-00-<topic>.mdintro covering: what the lab demonstrates, prerequisites, architecture, and how to run it. - Notebooks should be numbered
NN-01-…,NN-02-…, etc., in execution order. - If the lab provisions resources, include a
main.bicepand document the deployment step in the intro. - Add any new env vars to
.env.examplewith placeholder values. - Add the lab to the index table in
README.md. - Add each notebook to
scripts/notebooks.txtwith its tags (weeklyif it only uses resources that are already deployed).
- Offline checks (
offline-checks.yml) run on every PR and push tomain: the lock matchespyproject.toml, every import and SDK model keyword argument in the notebooks resolves (scripts/check_imports.py,scripts/check_sdk_kwargs.py), the unit tests pass, each hosted-agent image and Function app installs, andscripts/notebooks.txtlists every notebook. - Dependency canary (
dependency-canary.yml, Mondays 05:00 UTC) repeats those checks on the newest allowed releases without committing anything, and opens a tracking issue when they fail. - Live notebooks (
live-notebooks.yml, Mondays 07:00 UTC) runs theweeklynotebooks against the lab Azure environment, reruns any failure on the committed lock to tell package regressions from Azure drift, and opens a tracking issue when something fails. Other tags (deploy,ingest,long) run on demand from the Actions tab.
Run notebooks locally the same way:
uv run python scripts/run_notebooks.py --tags weekly
uv run python scripts/run_notebooks.py --only <path> --save --verboseBefore requesting review:
- On a feature branch (not
main) - Notebook runs top-to-bottom on a clean kernel
-
uv syncsucceeds; no new heavyweight deps without justification -
uv run python scripts/check_imports.pypasses (CI runs it on every PR) - New notebooks listed in
scripts/notebooks.txtwith their tags - New env vars added to
.env.example - Lab added (or updated) in the index table of
README.md - No secrets in committed files (
.env, keys, connection strings) -
pre-commithook passes (gitleaks secret scan) - Notebook outputs scrubbed of subscription IDs, resource names, and hostnames
- Screenshots placed under
docs/screenshots/
Open a GitHub issue. Use navigable links to files
([config.py](src/config.py)) rather than plain backticks so reviewers can click
through. Include the lab number and notebook step in the title where possible.
If you spot a typo, broken link, or stale screenshot, a one-line PR is perfectly welcome.