How azure-ai-foundry/foundry-samples works
Project type and purpose
• This is an open-source documentation sample repository for Azure AI Foundry.
• It contains end-to-end examples, language-specific sample code (Python, Java, C#, JavaScript), infrastructure-as-code modules (Bicep), notebooks, and supporting test plugins.
High-level components in the file tree
• .github/ – CI/CD workflows and helper scripts (pre-commit, PR checks, file-size diff summary).
• .infra/ – Infrastructure-as-code modules (Bicep templates) and custom pytest plugins.
• doc-samples/ – Language-specific “getting started” tutorials (Java, Python, .NET) and notebooks.
• samples/ – A large catalog of prebuilt agent examples (3p-agent SDKs, MSFT-agent SDKs, Semantic Kernel SDK, VSCode extensions).
• libs/ and archive/ – Built wheel packages for distribution and historical artifacts.
• dev-requirements.txt, tox.ini, pre-commit-config.yaml – Developer toolchain and test configurations.
• README.md, CONTRIBUTING.md, LICENSE, SECURITY.md – Project documentation.
Key relationships and flows
• Developer workflow: clone repo → install dev requirements → run pre-commit hooks → run pytest with custom plugin → explore or run samples locally.
• CI/CD (GitHub Actions): on PR/pre-commit → lint & format checks (pre-commit) → run tests (pytest + changed_samples plugin) → build wheel packages → validate Bicep deployments in infra folder.
• Infra provisioning: Bicep modules in .infra/deployment/ and samples’ deploy.bicep scripts define Azure resources (AI projects, container registry, key vault, storage accounts, Function Apps, etc.).
• Documentation: markdown files and notebooks link to sample code.
Important architectural patterns and principles
• Monorepo: All sample code, infra, CI, and packaging coexist in one repository.
• Modular infra: Bicep modules encapsulate Azure resource concerns (storage, key vault, role assignments, AI workspace).
• Language-agnostic samples: Patterns repeated across languages for parity in documentation.
• Plugin-driven testing: A custom pytest plugin (pytest_changed_samples) to run only changed samples for faster feedback.
• CI as code: GitHub workflows guard code quality and packaging.