Lesson 3 of 5 ALM for AI Solutions

Designing ALM for Foundry Agents

This lesson explains the lifecycle, versions and release process for Foundry agents.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the Foundry agent lifecycle and versions.
  • Explain the elements of a release process.
  • Identify changes that require re-evaluation.

The Foundry agent lifecycle

Microsoft describes the lifecycle of a Foundry agent as create, test, trace, evaluate, optimize, publish and monitor. Agent Service supports this lifecycle with versions: each change to an agent's definition is snapshotted automatically as a version, a team can roll back to an earlier version, and a version can be promoted to a stable endpoint that applications call. Published agents can be distributed to Microsoft 365 Copilot and Teams and registered in the Microsoft Entra agent registry. Hosted agents, which run the team's own code in a container, also carry the lifecycle of that code.

Because a Foundry agent is defined by its instructions, model deployment, tools and, for hosted agents, code, its ALM must manage all of these together.

Designing the process

A robust design treats the agent as code and infrastructure.

  • Separate projects or resources per environment, such as development, test and production, so that changes are tested before they reach users.
  • Infrastructure as code: Foundry resources, projects, model deployments, connections and networking are defined in templates such as Bicep and deployed through a pipeline; the Azure Developer CLI (azd) provides a documented path for provisioning and deploying.
  • Agent definitions in source control: instructions, tool definitions and code are versioned in Git, so every change is reviewed.
  • Evaluation gates: the pipeline runs evaluations on a fixed data set and blocks promotion if quality or safety scores fall below thresholds.
  • Controlled promotion: only a version that passed the gates is promoted to the stable endpoint, and rollback to the previous version is planned.
  • Observability in every environment: tracing and Application Insights are enabled from development onward, so that behaviour can be compared across environments.

Model dependencies

A Foundry agent depends on a model deployment, and models change: new versions appear, older versions retire, and quotas differ by region. ALM must track which model deployment and version each agent version uses, test agents against new model versions before switching, and plan for retirement dates. The following table shows changes that should trigger the full evaluation suite.

ChangeWhy it needs evaluation
Instructions or tool definitions changeDirectly alters behaviour
The model deployment or version changesThe same prompt can behave differently on a new model
A knowledge index is rebuiltRetrieval results may change
A tool's API changesCalls may fail or return different data
Guardrail configuration changesSafety behaviour may change
Worked example

Releasing a Foundry agent safely

A bank's Foundry agent answers analysts' questions about market research. Developers update its instructions in the production project when analysts complain, and last week a change made the agent cite unapproved sources. The bank wants changes reviewed, tested and reversible. What should you recommend?

The agent definition should move to source control, with separate development, test and production projects provisioned by infrastructure as code. Changes are made through pull requests and deployed by a pipeline that runs evaluations, including groundedness and a check that answers cite only approved sources, before promotion. Only versions that pass are promoted to the production stable endpoint, and because Agent Service keeps versions, the team can roll back immediately if a problem appears. Direct changes in production stop.

Check yourself

What does Foundry Agent Service do each time an agent's definition changes?

Show answer

It snapshots a new version automatically, which can later be rolled back or promoted to a stable endpoint.

Exam Tips

Remember for the exam

  • Foundry agent versions are snapshotted automatically, can be rolled back and promoted to a stable endpoint.
  • Use separate projects per environment, infrastructure as code and agent definitions in Git.
  • Gate promotion with evaluations on a fixed data set.
  • Track model deployments and versions; re-evaluate when the model changes.