Skip to lesson

MicrosoftMicrosoft Certified: Multi-Agent AI Solutions Expert2026-101.2 Specify technology components to include in a multi-agent solution

Rebuild the agent development environment reliably

Completed by the knowledge check

Learning objective

Configure reproducible development environments with dev containers, VS Code extensions, CLIs, dependencies, and AI instructions.

Core idea

A reproducible development environment is a reviewed definition that another contributor can rebuild and verify. It includes the runtime, operating-system tools, dependency resolution, editor capabilities, cloud target, and coding-agent instructions. For an architect, the goal is to reduce unexplained differences between machines while keeping credentials and authorization separate from the shared definition.

A dev container covers the local toolchain. It does not freeze a remote model deployment, grant access to a Foundry project, or guarantee that an AI coding assistant produces the same change. Treat the environment definition as one input to reproducible execution, alongside the evidence and versions described in 1.2.7.

How it works

Describe the container instead of the machine

The VS Code Dev Containers extension opens a repository in a container with its own tool and runtime stack. Configuration lives in .devcontainer/devcontainer.json or a root .devcontainer.json. The definition can reference an image, use a Dockerfile, or work with Docker Compose when development needs several services.

Choose a reviewed base image and retain a specific version or immutable digest as an application practice. Put system packages and tools that do not depend on the workspace in the Dockerfile. Record their versions rather than expecting every developer to reproduce an unrecorded sequence of terminal commands. A mutable image tag or an unconstrained package installation can change the environment even when the repository revision stays the same.

Use postCreateCommand for setup that needs the mounted workspace, such as executing the repository’s dependency-install script. A Dockerfile runs before the workspace is mounted; postCreateCommand runs after the container is created. This distinction decides where a lockfile-based installation belongs. Keep the setup script safe to rerun and ensure failures remain visible instead of leaving a partially configured environment that appears ready.

VS Code documents Dev Containers: Reopen in Container for opening the configured environment. Rebuilding removes manually installed software unless its installation is represented in the Dockerfile or setup command. Record interactive repairs in the definition before claiming reproducibility.

Declare editor capabilities

The customizations.vscode.extensions array in devcontainer.json declares extensions to install in the container. forwardPorts exposes the application’s local development ports to the developer. Extensions enable editor behavior; port forwarding makes services reachable. Neither installs application dependencies.

Select extensions for the chosen language and workflow. Microsoft’s Foundry environment guide specifies extension IDs ms-python.python for the Python extension and ms-dotnettools.csdevkit for C# Dev Kit. For Python, the guide requires Python 3.10 or later and recommends a project virtual environment rather than globally installed packages. A minimum supported version is not an exact reproducibility pin: record the team’s tested interpreter version as well.

Microsoft Foundry Toolkit for Visual Studio Code provides the Foundry editor experience and depends on the .NET Runtime. Its installation check is that the Foundry Toolkit view contains My Resources, Developer Tools, and Help And Feedback. Include that runtime requirement in the environment definition if the extension runs inside your container. An installed extension that cannot activate is not a completed setup.

The Foundry DevPack bundles azd, azd ai, Microsoft Foundry Skill, and editor integrations when their host apps are present. Foundry Canvas is marked preview and is installed only when GitHub Copilot App is present. DevPack is a convenient onboarding path, but its host-dependent contents do not replace a reviewed manifest of the tools your project actually requires.

Separate CLI installation from cloud selection

Record which command-line interfaces (CLIs) and extensions the repository expects, with the tested versions and required checks. Besides a Dockerfile, the features property in devcontainer.json declaratively installs tools through Dev Container Features. The documented Azure CLI Feature ID is ghcr.io/devcontainers/features/azure-cli:1: :1 selects the Feature version line, while its version option selects the Azure CLI version. Use a tested CLI version rather than the example’s floating value. Do not treat an authenticated terminal on the author’s machine as part of the environment artifact. A contributor still needs an authorized identity and the intended cloud target.

Azure Developer CLI uses azd init to initialize a project from a template, azd auth login to authenticate, and azd up to provision and deploy the application. Initialization, authentication, and deployment are different actions. Rebuilding a local container should not automatically execute a provisioning command against whichever subscription happens to be selected.

Foundry workflow context can come from azure.yaml, which describes azd services, project folders, deployment hosts, and environment bindings. .azure/<environment>/.env holds environment values such as subscription, resource group, project endpoint, registry, and Application Insights connection string. Make the target explicit and handle sensitive values through the project’s approved credential process rather than baking them into the image.

For nonsecret Foundry overlay state, the Microsoft Foundry Skill documents .foundry/agent-metadata.yaml and environment-specific .foundry/agent-metadata.<env>.yaml. eval.yaml expresses evaluation intent, including dataset and evaluator references. Avoid duplicating an endpoint already supplied by azd in a second metadata file: two competing values make the same checkout point to different environments.

Freeze dependencies and AI guidance

Keep application dependency declarations and lockfiles with the code, and have setup use the repository’s locked installation path. Validate the installed SDK interfaces: an unconstrained update can break agent definitions even with the correct interpreter.

Use AI instructions to state decisions that code alone cannot reliably convey: supported frameworks, module ownership, test commands, security rules, and deployment restrictions. VS Code’s instruction discovery depends on the selected agent harness. For Copilot sessions, project-wide guidance can use .github/copilot-instructions.md or AGENTS.md; targeted guidance uses .github/instructions/**/*.instructions.md. An applyTo glob scopes an instructions file to matching files, while description helps discovery by task relevance.

VS Code’s Local agent discovers .github/copilot-instructions.md when github.copilot.chat.codeGeneration.useInstructionFiles is enabled. Do not assume the same settings and discovery rules apply to every harness. File-based instructions replace deprecated settings-based code-generation and test-generation instructions; the documented deprecation starts with VS Code 1.102.

Keep shared instructions consistent and verify that the intended harness discovers them. Instructions guide generated work; tests and policy checks enforce acceptance. They also differ from the production agent’s runtime instructions: changing coding guidance does not automatically update the deployed agent’s behavior.

Key distinctions and trade-offs

Container definition versus live container: The definition survives rebuilds; manual changes inside the running container do not establish a repeatable setup.

Dependency pin versus supported minimum: A minimum version defines compatibility. A tested pin and locked dependency graph define the environment you verified.

CLI availability versus authorization: Installing azd makes commands available. Authentication and cloud target selection determine which resources they can affect.

AI instructions versus enforcement: Discoverable instructions improve consistency. Tests, validators, and access controls establish whether the resulting work is acceptable.

Prebuilt images reduce setup work but require maintenance. Post-creation installation depends on package availability. Choose one reviewed installation path per tool and measure clean rebuild success.

Architecture / decision scenario

A team develops a Python multi-agent service. One contributor has a working machine, but a second receives import errors and a third deploys against an unintended project.

The team commits a dev container definition, a Dockerfile with its tested interpreter and azd version, an Azure CLI entry under features with its tested CLI version, and a workspace setup script invoked by postCreateCommand. The script installs the locked application dependencies and runs the repository’s verification commands. The extension list includes the chosen Python and Foundry tools, with the .NET Runtime available where Foundry Toolkit activates.

azure.yaml describes the application, while environment-specific values identify the intended development Foundry project. Contributors authenticate separately with azd auth login; local rebuilds do not run azd up. The team checks the selected target before any cloud deployment.

Project AI instructions name ownership, dependency policy, and validation commands. Targeted .instructions.md files use applyTo for specialist modules. The team tests instruction discovery in its chosen harness, rebuilds from a clean checkout, verifies tool versions and extension activation, and runs a controlled agent request. That evidence covers all five environment layers without treating successful provisioning or identical generated text as the setup criterion.

Common exam traps

  • Treating manual repairs inside a container as persistent configuration.
  • Running workspace-dependent installation in a Dockerfile before the workspace is mounted.
  • Assuming extension installation also installs application packages or required runtimes.
  • Treating a supported minimum version as a reproducibility pin.
  • Mixing azd init, authentication, and cloud provisioning into one automatic rebuild action.
  • Assuming an instructions file is discovered identically by every harness or enforces production authorization.

What to remember

Version the container, editor capabilities, CLIs, dependency graph, and AI guidance as one reviewed development contract. Keep credentials and target selection explicit. Prove the contract through a clean rebuild, tool and extension checks, instruction discovery, and the application’s verification commands.

Knowledge check

References