Releasing Across Environments and Rolling Back Safely
This lesson covers environment design, rollback and release management for a multi-agent solution made of many versioned parts, agent definitions, prompts, tools, models, indexes, infrastructure and data, each of which must be reversible.
Learning outcomes
After completing this lesson, you will be able to:
- Keep environments consistent with infrastructure as code.
- Identify how each part of a solution is versioned and rolled back.
- Record release history for release management.
Consistent environments
Each environment has its own Foundry resource or project, model deployments, search indexes, data stores, identities and Key Vault, created from the same infrastructure-as-code templates with environment-specific parameters (names, SKUs, capacities, network settings). Agent definitions, prompts, tool code and evaluation datasets live in source control and are deployed by the pipeline. Manual changes in production are prohibited or detected as drift, because an environment that differs from its definition cannot be reliably reproduced or rolled back.
Consistent environments
What to version and how to roll back
Rollback must be possible for every part of the solution. The following table lists the parts and how each is rolled back.
| Part | Versioning | Rollback |
|---|---|---|
| Agent definitions and prompts | Source control; Foundry agent versions | Redeploy or reactivate the previous version |
| Tool and orchestrator code | Container image tags, revisions | Shift traffic to the previous revision |
| Model deployments | Pinned model version | Point the deployment name back to the previous model or version |
| Infrastructure | IaC templates in source control | Redeploy the previous template |
| Indexes and memory schemas | Schema versions, index aliases | Switch the alias back; keep schemas backward compatible |
Data is the hardest part to roll back. Index changes are made by building a new index and switching an alias, so the old index remains available. Memory and state schema changes are additive and backward compatible, so the previous code can still read the data. Model versions are pinned and automatic upgrades are disabled in production, because a provider-side upgrade can change behaviour outside the release process.
Rolling back each part
Release management and rollout
Release management records what was deployed, where, when, by whom and with which test and evaluation results, usually through the pipeline's deployment history and environment approvals. Rollout strategies limit blast radius: by region (one region first), by tenant (internal users or a pilot customer first), or by traffic share (canary). Releases of interdependent agents are coordinated so that contracts between them stay compatible, or each agent accepts both the old and new message formats during the transition.
Rolling out safely
A rollback that did not work
After a release that changed an agent's prompt, its tool code and the memory schema, quality dropped. The team redeployed the previous agent version and container image, but the agent now fails when reading memories written during the faulty release.
The memory schema change was not backward compatible. Schema changes should be additive (new optional fields) and deployed separately before code that depends on them, so that previous code versions can still read the data. A migration to restore compatibility is needed now, and the release process should test rollback, not only deployment.
Why pin model versions in every environment?
Show answer
So that an automatic model update cannot change behaviour unnoticed, and a rollback returns to exactly what was tested.
Exam Tips
Remember for the exam
- Same IaC templates with parameters for every environment; no manual production changes.
- Version and be able to roll back prompts, agents, code, models, infrastructure and schemas.
- Pin model versions; keep data schemas backward compatible; test rollback.