Domain 3 of 5 · Chapter 3 of 3

Prompt Versioning and Source Control

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing Operationalizing Machine Learning and Generative AI Solutions premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • Prompts are code: version them like code
  • Design and develop the prompt
  • Version control with a Git repository
  • Create variants and compare with evaluations
  • Prompt flow is retiring; agents as config in CI/CD
  • Exam-pattern recognition

Prompt agent vs hosted agent

AspectPrompt agentHosted agent
What you authorDeclarative config: instructions, a model, and toolsYour own code using any agent framework
How it's versioned in source controlConfig files committed to GitCode in Git, built and pushed as a container image to Azure Container Registry
Compute to run and pay forNone; Foundry runs it with no compute to manageContainer compute you pay for; deprovisioned after 15 minutes idle
Runtime identityManaged by FoundryDedicated Microsoft Entra agent identity minted per agent at deploy
Versioning and rollbackBuilt-in version snapshots; promote through CI/CDEach deploy is a new immutable version; previous versions kept for rollback
Choose whenAgent needs only a model, instructions, and built-in toolsAgent must run custom orchestration or framework code

Decision tree

Tracking prompt versions?need review + rollbackGit repocommits, branches, tags, PRsPortal run historynot a version storeComparing prompt variants?pick the better promptFoundry evaluationssame fixed datasetPrompt flow variantsretiring - avoidAgent needs custom code?own orchestration/frameworkHosted agentcontainer image to ACRPrompt agentconfig, promote via CI/CDtrack itad hoccompareavoidcustom codeno code

Cheat sheet

  • A prompt's system message and instructions define agent behavior and grounding
  • Store prompts as code assets in a Git repository
  • A repo structure separates prompt versions and environments
  • Compare prompt versions with Foundry evaluations on a fixed dataset
  • Prompt flow is retiring; build new prompt and agent orchestration on Agent Framework
  • Define agents and prompts as configuration and promote them through CI/CD
  • Choose a prompt agent or a hosted agent to operationalize an agent
  • Hosted-agent deployment lifecycle: versioned deploys, auto identity, tracing, and scale-to-zero

Unlock with Premium — includes all practice exams and the complete study guide.

References

  1. Microsoft Foundry Playgrounds - Microsoft Foundry
  2. MLOps and GenAIOps for AI Workloads on Azure - Microsoft Azure Well-Architected Framework Well-Architected
  3. Manage prompts for agents in Microsoft Foundry with GitHub - Training
  4. System message design for Azure OpenAI - Microsoft Foundry
  5. Optimize agent prompts with Prompt Optimizer (preview) - Microsoft Foundry
  6. Generative AI Operations for Organizations with MLOps Investments - Azure Architecture Center
  7. Run evaluations from the Microsoft Foundry portal - Microsoft Foundry
  8. Cloud Evaluation with the Microsoft Foundry SDK - Microsoft Foundry
  9. How to run an evaluation in GitHub Action - Microsoft Foundry
  10. Prompt flow in Microsoft Foundry portal (classic) - Microsoft Foundry (classic) portal
  11. Agent Framework documentation
  12. Migrate from Prompt Flow to Microsoft Agent Framework in Foundry (classic) - Microsoft Foundry
  13. What is Microsoft Foundry Agent Service? - Microsoft Foundry
  14. Hosted agents in Foundry Agent Service - Microsoft Foundry
  15. Deploy a hosted agent - Microsoft Foundry