Build, Buy, or Extend
Determine when to use prebuilt agents, extend M365 Copilot, build in Copilot Studio or Foundry, or create custom AI models β using a structured decision hierarchy.
The cheapest agent is the one you do not build
Imagine you need a shelf. You could buy one from a furniture store, customise a flat-pack kit, hire a carpenter, or grow the tree yourself.
Each option costs more time and effort. The furniture store shelf (prebuilt agent) works if it fits your space. The flat-pack kit (extending Copilot) lets you adjust the dimensions. The carpenter (Copilot Studio or Foundry) builds exactly what you want. Growing the tree (custom model) only makes sense if no wood on earth matches your requirements.
The exam rewards choosing the simplest option that meets the requirement. Start from βbuyβ and only escalate when you hit a wall.
Prebuilt agent sources
Before building anything, check what already exists:
| Source | What You Get | Examples |
|---|---|---|
| D365 prebuilt AI | Ready-to-use AI features embedded in Dynamics 365 apps | Sales forecasting in D365 Sales, sentiment analysis in D365 Customer Service, cash flow predictions in D365 Finance |
| M365 Copilot agents | Built-in agents available to all Copilot-licensed users | Researcher (deep web research), Analyst (advanced data analysis), Facilitator (meeting follow-up) |
| Copilot Studio templates | Pre-configured agent templates you can customise | IT helpdesk, HR FAQ, employee onboarding, customer support |
| ISV and partner agents | Third-party agents from AppSource and partner marketplace | Industry-specific agents (healthcare scheduling, legal document review, financial compliance) |
The decision matrix
| Feature | Use Prebuilt | Extend M365 Copilot | Build in Copilot Studio | Build in Foundry |
|---|---|---|---|---|
| Time to value | Hours to days | Days to weeks | Weeks to months | Months |
| Cost | Included in licence | Licence + minor dev effort | Licence + moderate dev effort | Licence + significant dev + compute |
| Customisation | None to minimal | Moderate β plugins, connectors, prompts | High β full agent design within low-code | Full β model, tools, orchestration, UX |
| Maintenance | Microsoft handles everything | Shared β Microsoft platform, your extensions | Shared β platform updates, your agent logic | You own model ops, drift, retraining |
| Technical skill | Admin or end user | Power user or developer | Citizen dev with pro-code escape | AI engineer, data scientist, developer |
| Data access | Native D365/M365 data only | M365 Graph + custom connectors | Dataverse + connectors + custom APIs | Any Azure data source, Fabric, external |
| Best for | Standard features that fit as-is | M365 productivity needs + org-specific data | Customer-facing agents, process automation | Complex reasoning, custom models, multi-agent |
The five-step decision hierarchy
Work through these steps in order. Stop as soon as a step meets the requirement:
Step 1: Does a prebuilt agent or feature already exist? Check D365 embedded AI, M365 Copilot agents, Copilot Studio templates, and ISV marketplace. If the prebuilt feature covers 80%+ of the requirement, use it.
Step 2: Can you extend M365 Copilot? If users need AI assistance within their M365 workflow and the gap is data access or a specific action, extend Copilot with a declarative agent, Graph connector, or API plugin.
Step 3: Should you build in Copilot Studio? If you need a standalone agent with channel support (web, Teams, phone), process automation, or customer-facing interaction β and the logic does not require custom models β build in Copilot Studio.
Step 4: Should you build in Foundry? If you need code-first orchestration, custom model hosting, multi-agent coordination, or access to Azure-scale compute and data β build in Foundry.
Step 5: Do you need a custom AI model? Only if general-purpose models cannot handle your domain after prompt engineering and RAG have been tried. This is the most expensive and maintenance-heavy option.
Platform constraints to know
| Platform | Key Constraints |
|---|---|
| Copilot Studio | Message size limits (variable by channel). Canvas topics limited to ~200 nodes. No native model hosting β calls external models via HTTP. Data must be in Dataverse or accessible via connector. Environment-level DLP policies apply. |
| Microsoft Foundry | Compute quotas per subscription (TPM limits by model and region). Model deployment requires approval for certain models. Network isolation requires private endpoints for production. Cost scales with usage β no flat-rate pricing for compute. |
| M365 Copilot (extensions) | All data access goes through Microsoft Graph β no direct database queries. Declarative agents limited to instructions, knowledge, and actions. API plugins must follow the OpenAPI spec. Tenant admin must approve third-party plugins. |
| D365 Embedded AI | Features are per-app β no cross-app AI orchestration natively. Configuration only, no custom logic. Availability varies by D365 licence tier. Model retraining is not user-controlled. |
When custom AI models are justified
Do not jump to custom models. Follow this escalation path:
| Approach | When to Use | Example |
|---|---|---|
| Prompt engineering | Standard text generation, summarisation, classification with a general model | Summarise customer service cases using GPT-4o with a well-crafted system prompt |
| RAG (Retrieval-Augmented Generation) | Domain knowledge needed but the modelβs reasoning is sufficient | Agent that answers questions about internal policies by retrieving from a SharePoint index |
| Fine-tuning | Domain terminology, tone, or patterns that prompts and RAG cannot capture | Medical coding agent that must use precise ICD-10 codes consistently |
| Train from scratch | Truly novel domain with no transfer learning benefit, or edge/embedded inference | Custom defect detection model for a specific manufacturing process using proprietary sensor data |
The RAG-before-fine-tune rule
This is a critical exam concept. Before investing in model customisation, exhaust the cheaper options in order:
- Prompt engineering β Refine the system prompt, add examples (few-shot), structure the output format. Cost: near zero. Time: hours.
- RAG β Ground the model with retrieved documents from Azure AI Search, Fabric, or Dataverse. The model reasons over your data without being retrained. Cost: search index + retrieval compute. Time: days to weeks.
- Fine-tuning β Train the model on your domain-specific data to adjust its weights. Needed when the model consistently misuses terminology, misses domain patterns, or requires a specific output style that prompts cannot enforce. Cost: training compute + ongoing retraining. Time: weeks.
- Train from scratch β Only when no pretrained model transfers to your domain. Extremely rare for business solutions. Cost: massive compute + large labelled dataset. Time: months.
The exam will present scenarios where a candidate might jump to fine-tuning. The correct answer is almost always βtry RAG first.β Fine-tuning is justified only when RAG is demonstrably insufficient.
ποΈ Adrienneβs credit risk agent β a hybrid architecture
Adrienne Cole (VP Enterprise Tech, Vanguard Financial Group) needs an agent that assesses credit risk for commercial loan applications.
Step 1: Prebuilt? D365 Finance has credit management features but they are rule-based, not AI-powered. Not sufficient for the nuanced risk assessment Vanguard needs.
Step 2: Extend M365 Copilot? The agent needs to access financial models and external credit bureau data β not M365 data. Copilot extensions do not fit.
Step 3: Copilot Studio? The agent needs custom model inference (risk scoring) that Copilot Studio cannot host natively. However, the user interface β where loan officers interact with the agent β is a great fit for Copilot Studio.
Step 4: Foundry? Yes. The risk scoring model lives in Foundry, with access to Azure SQL (historical loan performance), external credit bureau APIs, and a Fabric lakehouse of market indicators.
Step 5: Custom model? Adrienneβs team tries RAG first β retrieve historical loan decisions and let GPT-4o reason over them. It works for 80% of cases but struggles with Vanguardβs proprietary risk weighting methodology. Dev Patel (AI platform engineer) fine-tunes a model on 100,000 historical risk assessments. The fine-tuned model achieves 94% agreement with senior analysts.
Final architecture:
- Front-end: Copilot Studio agent in Teams β loan officers submit applications and receive risk assessments
- Back-end: Foundry-hosted fine-tuned model performs risk scoring, orchestrated by a Foundry agent that retrieves data from multiple sources
- Integration: Copilot Studio calls Foundry via HTTP connector. Results written back to D365 Finance for the loan record.
Marcus Webb (CISO) adds guardrails: all risk scores above βhighβ require human analyst review before the recommendation reaches the loan officer. Yuki Tanaka (compliance) ensures every assessment is logged with full explainability for regulatory audit.
Key terms
Knowledge check
A D365 Customer Service team wants an AI agent that summarises case history and suggests next best actions using data already in Dataverse. No custom model is needed. Which approach is correct?
Adrienne's team tried RAG for the credit risk agent but it struggles with Vanguard's proprietary risk weighting methodology. What should they do next?
A company wants to add a 'query our product catalogue' capability to M365 Copilot so employees can ask questions about products in natural language. The catalogue lives in a third-party PIM system. What is the simplest sufficient approach?
π¬ Video coming soon
Next up: Generative AI and Prompt Design β design effective prompts and understand how generative AI fits into your business solution architecture.