Setting Up a Reproducible Developer Environment and Toolchain
This lesson describes the developer environment and toolchain named in the skills outline, which make work on Python code, prompts, infrastructure templates and evaluation datasets reproducible from a laptop to the pipeline.
Learning outcomes
After completing this lesson, you will be able to:
- Define a dev container for a multi-agent project.
- Identify the Visual Studio Code extensions and CLIs for Foundry development.
- Manage dependencies and coding-assistant instructions.
- Use the same definitions from the laptop to the pipeline.
Dev containers
A dev container is a container image defined in .devcontainer/devcontainer.json that includes the language runtime, CLIs, VS Code extensions and setup commands. Visual Studio Code and GitHub Codespaces open the repository inside it, so every developer and reviewer has the same Python version, SDKs and tools, and the CI pipeline can use the same image.
{
"name": "multi-agent",
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/azure/azure-dev/azd:0": {}
},
"customizations": {"vscode": {"extensions": ["ms-python.python", "TeamsDevApp.vscode-ai-foundry"]}},
"postCreateCommand": "pip install -r requirements.txt"
}Dev containers
Visual Studio Code extensions and CLIs
The Microsoft Foundry extension for Visual Studio Code lets developers browse deployments, create and test agents, and view traces without leaving the editor. The AI Toolkit extension adds model playgrounds, prompt experimentation and evaluation. The Azure CLI manages resources and role assignments, and the Azure Developer CLI (azd) provisions infrastructure from Bicep or Terraform templates and deploys application code with commands such as azd up; its AI agent extension scaffolds and deploys Foundry agents.
Developer tools
Dependency management and AI instructions
Agent SDKs release frequently and sometimes rename classes, so dependency management pins exact versions in a lock file (for example with uv or pip-tools), updates them deliberately through pull requests and scans them for vulnerabilities. Optional extras, such as Agent Framework integration packages, are listed explicitly.
AI instructions are repository files that guide coding assistants, such as .github/copilot-instructions.md or AGENTS.md. They record conventions (keyless authentication, logging format, how to add a tool), commands to run tests and evaluations, and rules the assistant must follow, so that generated code matches the project's standards.
From laptop to pipeline
The value of these tools comes from using the same definitions at every stage. A developer opens the repository in the dev container, runs the agent locally against a development Foundry project, and runs the same unit tests and evaluation scripts that the pipeline will run. The pull request then triggers a pipeline that builds from the same container image and lock file, provisions or updates the environment from the same infrastructure templates, and runs the evaluations as a gate.
Differences between stages are limited to configuration, such as endpoints, deployment names and the identities used. When a problem appears only in the pipeline or in production, the cause is therefore likely to be configuration or data rather than code or tooling, which narrows the investigation. The following table summarizes which artefact keeps each part of the environment consistent.
| Concern | Artefact that keeps it consistent |
|---|---|
| Runtime, CLIs and extensions | Dev container definition |
| Python packages | Lock file |
| Azure resources | Bicep or Terraform templates deployed with azd or the pipeline |
| Agent definitions and prompts | Files in source control deployed by the pipeline |
| Coding conventions for assistants | AI instruction files in the repository |
Keeping every stage consistent
Onboarding new developers
New developers on a multi-agent project spend two days installing tools, and code they write with a coding assistant often uses API keys instead of the project's keyless authentication.
A dev container with the runtime, CLIs and extensions removes the setup time, and an AI instructions file that states the keyless authentication rule and shows the project's credential pattern steers the assistant. A wiki page alone would not be applied automatically by either the environment or the assistant.
How can every developer and the CI pipeline use the same environment?
Show answer
With dev containers, which define the tools and dependencies once and run the same way locally and in CI.
Exam Tips
Remember for the exam
- Same environment everywhere: dev containers, also usable in CI.
- azd provisions and deploys from templates; the Foundry extension tests agents in VS Code.
- AI instruction files steer coding assistants to project conventions.