Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This repository contains [Microsoft 365 Copilot](https://learn.microsoft.com/mic
| [Declarative Agent with an API plugin that secured by Entra ID that validates its own tokens](./samples/da-XBoxGameMaster) | This sample demonstrates how to build a declarative agent for Microsoft 365 Copilot that answers questions about repairs. The agent uses an API plugin to connect to an API secured with OAuth. The project contains an Azure Function that validates tokens using an open source library. | Bob German |
| [Declarative for Microsoft 365 Copilot with an API plugin connected to an API secured with OAuth](./samples/da-repairs-oauth) | This sample demonstrates how to build a declarative agent for Microsoft 365 Copilot that answers questions about repairs. The agent uses an API plugin to connect to an API secured with OAuth. The project contains an Azure Function that serves as the API and uses the built-in Azure App Service authentication and authorization capabilities (also referred to as Easy Auth) to secure access to APIs. | Waldek Mastykarz |
| [Document Finder Declarative Agent for Microsoft 365 Copilot Sample](./samples/da-DocFinder) | First Party Declarative Agent Document Finder shared as a sample | Jeremy Thake |
| [Dynamics 365 Advisor](./samples/da-dynamics365-advisor) | A declarative agent that provides expert guidance on Dynamics 365 CRM, Power Platform, automation workflows, and Copilot Studio solutions. | Muhammad Shahzad Shafique |
| [ESA, The Environment Sustainability Agent using Microsoft 365 Copilot](./samples/da-environmentSustainability) | This sample showcases how to build a declarative agent for Microsoft 365 Copilot connected to a SharePoint site as knowledge base, named ESA, the Environment Sustainability Agent. ESA is an intelligent assistant developed to assist organizations in monitoring and optimizing their environmental impact. | Rabia Williams |
| [Executive Helper - Meeting preparation with executive bios](./samples/da-executive-helper) | A declarative agent that automates meeting preparation by generating comprehensive executive bios with career insights and rapport-building questions. | Microsoft 365 & Power Platform Community |
| [Foodbank Friend](./samples/da-foodbank-friend) | A declarative agent that helps users in the UK find local food banks, see what items they need, and schedule volunteer donation visits using the GiveFood API, Outlook Calendar, and SharePoint Lists. | Lee Ford |
Expand Down
15 changes: 15 additions & 0 deletions samples/da-dynamics365-advisor/.env.local.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Sample environment file for Dynamics 365 Advisor Agent
# Copy this to .env.local and fill in your values
# DO NOT commit .env.local to git!
Comment thread
MrShahzadShafique marked this conversation as resolved.

# Teams Toolkit Environment
TEAMSFX_ENV=dev

# Microsoft 365 / Azure AD (if needed for future API integrations)
# TENANT_ID=your-tenant-id-here
# CLIENT_ID=your-client-id-here
# CLIENT_SECRET=your-client-secret-here

# Optional: Dynamics 365 API Configuration (for future enhancements)
# DYNAMICS_API_ENDPOINT=https://your-org.crm.dynamics.com
# DYNAMICS_CLIENT_ID=your-dynamics-app-id
14 changes: 14 additions & 0 deletions samples/da-dynamics365-advisor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# TeamsFx files
env/.env.*.user
env/.env.local
.env.local
.localConfigs
appPackage/build
Comment thread
MrShahzadShafique marked this conversation as resolved.

# dependencies
node_modules/

# misc
.env
.deployment
.DS_Store
113 changes: 113 additions & 0 deletions samples/da-dynamics365-advisor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Dynamics 365 Advisor Agent

## Summary

An expert declarative agent for Microsoft 365 Copilot that provides guidance on Dynamics 365 CRM, Power Platform, and Copilot solutions. This agent helps users with CRM architecture decisions, entity design, security models, Power Automate workflows, and business process automation.

![Dynamics 365 Advisor in action](assets/screenshot.png)

## Tools and Frameworks

![drop](https://img.shields.io/badge/Teams Toolkit for VS Code-5.0+-green.svg)
![drop](https://img.shields.io/badge/Declarative Agent-v1.3-blue.svg)

## Prerequisites

* [Microsoft 365 Developer Account](https://developer.microsoft.com/microsoft-365/dev-program)
* [Teams Toolkit for Visual Studio Code](https://learn.microsoft.com/microsoftteams/platform/toolkit/install-teams-toolkit?tabs=vscode)
* [Node.js LTS](https://nodejs.org/)
* [Visual Studio Code](https://code.visualstudio.com/)

## Version history

Version|Date|Author|Comments
-------|----|----|--------
1.0.0|April 28, 2026|Muhammad Shahzad Shafique|Initial release

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

---

## Minimal Path to Awesome

* Clone this repository (or [download this solution as a .ZIP file](https://pnp.github.io/download-partial/?url=https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-dynamics365-advisor) then unzip it)
* Open the `samples/da-dynamics365-advisor` folder in Visual Studio Code
* Select the Teams Toolkit icon on the left in the VS Code toolbar
* In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already
* Create the Teams app by selecting **Provision** in the "Lifecycle" section
* Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown
* Once the Copilot app is loaded in the browser, select the "..." menu and select **Copilot chats**. You will see the Dynamics 365 Advisor agent on the right rail
* Select the agent and start asking questions about Dynamics 365 CRM, Power Platform, or Copilot Studio

Comment thread
MrShahzadShafique marked this conversation as resolved.
## Features

This agent provides expert guidance on:

* **CRM Architecture Guidance** - Dynamics 365 CRM design and implementation
* **Entity & Table Design** - Data model design in Dynamics 365
* **Security Model Design** - Security roles, access levels, and multi-region deployment architecture
* **Power Automate Integration** - Workflow automation and business process recommendations
* **Copilot Studio Use Cases** - Customer service chatbot scenarios and implementations
* **Business Process Optimization** - Sales pipeline and customer service improvements
* **Plugin & Custom Code** - Custom development guidance and best practices

## Conversation Starters

The agent includes several conversation starters:

* **CRM Design** - "Help me design a case management solution in Dynamics 365."
* **Power Automate** - "Suggest a Power Automate flow for lead qualification."
* **Copilot Studio** - "Give me chatbot use cases for customer service."
* **Security Model** - "How should I design security roles for a 3-country CRM deployment?"

## File Structure

```
da-dynamics365-advisor/
+-- appPackage/
| +-- declarativeAgent.json # Agent configuration
| +-- instruction.txt # Agent instructions and behavior
| +-- manifest.json # Teams app manifest
| +-- color.png # App color icon
| +-- outline.png # App outline icon
+-- env/
| +-- .env.dev # Environment variables for dev
+-- assets/
| +-- screenshot.png # Demo screenshot
| +-- sample.json # Sample metadata
+-- .env.local.sample # Environment variables template
+-- .gitignore
+-- README.md
```

## Setup Instructions

1. **Open in VS Code**
- Open the `da-dynamics365-advisor` folder in Visual Studio Code
- Ensure Teams Toolkit extension is installed

2. **Review the Configuration**
- Check `appPackage/declarativeAgent.json` for agent settings
- Review `appPackage/instruction.txt` for agent behavior

3. **Run the Agent**
- Press F5 or use Teams Toolkit to start debugging
- Sign in with your Microsoft 365 account
- The agent will be deployed to your Copilot environment

4. **Test the Agent**
- Open Microsoft 365 Copilot
- Find "Dynamics 365 Advisor" in your agents
- Try the conversation starters or ask your own questions about:
- Dynamics 365 CRM architecture
- Power Platform solutions
- Security and access control
- Business process automation

## Author

* **Muhammad Shahzad Shafique** - [GitHub Profile](https://github.com/MrShahzadShafique)

<img src="https://m365-visitor-stats.azurewebsites.net/copilot-pro-dev-samples/samples/da-dynamics365-advisor" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions samples/da-dynamics365-advisor/appPackage/declarativeAgent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.3/schema.json",
"version": "v1.3",
"name": "Dynamics 365 Advisor",
"description": "Expert assistant for Dynamics 365 CRM, Power Platform, and Copilot solutions.",
"instructions": "$[file('instruction.txt')]",
"conversation_starters": [
{
"title": "CRM Design",
"text": "Help me design a case management solution in Dynamics 365."
},
{
"title": "Power Automate",
"text": "Suggest a Power Automate flow for lead qualification."
},
{
"title": "Copilot Studio",
"text": "Give me chatbot use cases for customer service."
},
{
"title": "Security Model",
"text": "How should I design security roles for a 3-country CRM deployment?"
}
]
}
21 changes: 21 additions & 0 deletions samples/da-dynamics365-advisor/appPackage/instruction.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
You are a Microsoft Dynamics 365 CRM and Power Platform advisor.

Your role is to help users with:

- CRM architecture decisions
- Entity and table design
- Security roles and access model
- Power Automate workflows
- Plugin and custom code recommendations
- Copilot Studio chatbot use cases
- Customer Service process automation
- Sales pipeline optimization
- Business requirement documentation

Rules:

- Provide structured and professional responses
- Prefer Microsoft best practices
- Ask clarifying questions when needed
- Keep answers practical and implementation-ready
- Use bullet points and executive summaries
37 changes: 37 additions & 0 deletions samples/da-dynamics365-advisor/appPackage/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.24/MicrosoftTeams.schema.json",
"manifestVersion": "1.24",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"name": {
"short": "Dynamics 365 Advisor",
"full": "Dynamics 365 Advisor for Microsoft 365 Copilot"
},
"developer": {
"name": "Dynamics 365 Advisor",
"websiteUrl": "https://www.example.com",
"privacyUrl": "https://www.example.com/privacy",
"termsOfUseUrl": "https://www.example.com/termsofuse"
},
"description": {
"short": "CRM & Power Platform advisory assistant",
"full": "Provides expert guidance for Dynamics 365 CRM, Power Platform, automation and Copilot."
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"copilotAgents": {
"declarativeAgents": [
{
"id": "declarative-agent",
Comment thread
MrShahzadShafique marked this conversation as resolved.
Outdated
Comment thread
MrShahzadShafique marked this conversation as resolved.
Outdated
Comment thread
MrShahzadShafique marked this conversation as resolved.
Outdated
"file": "declarativeAgent.json"
Comment thread
MrShahzadShafique marked this conversation as resolved.
}
]
},
"permissions": [
"identity"
Comment thread
MrShahzadShafique marked this conversation as resolved.
],
"validDomains": []
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions samples/da-dynamics365-advisor/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[
{
"name": "pnp-copilot-pro-dev-da-dynamics365-advisor",
"source": "pnp",
"title": "Dynamics 365 Advisor",
"shortDescription": "Expert declarative agent for Dynamics 365 CRM, Power Platform, and Copilot solutions guidance",
"url": "https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-dynamics365-advisor",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-dynamics365-advisor",
"longDescription": [
"A declarative agent that serves as an expert advisor for Dynamics 365 CRM and Power Platform solutions. Provides guidance on CRM architecture decisions, entity and table design, security models, Power Automate workflows, plugin development, Copilot Studio chatbot scenarios, and business process automation. Helps teams design scalable Dynamics 365 implementations with proper security role structures, optimized sales pipelines, and customer service automation."
],
"creationDateTime": "2026-04-28",
"updateDateTime": "2026-04-28",
"products": [
"Microsoft 365 Copilot",
"Dynamics 365",
"Power Platform"
],
"metadata": [
{
"key": "PLATFORM",
"value": "Copilot"
},
{
"key": "LANGUAGE",
"value": "JSON"
},
{
"key": "API-PLUGIN",
"value": "No"
},
{
"key": "GRAPH-CONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://raw.githubusercontent.com/pnp/copilot-pro-dev-samples/refs/heads/main/samples/da-dynamics365-advisor/assets/screenshot.png",
"alt": "Dynamics 365 Advisor Agent for Microsoft 365 Copilot"
}
],
"authors": [
{
"gitHubAccount": "MrShahzadShafique",
"pictureUrl": "https://github.com/MrShahzadShafique.png",
"name": "Muhammad Shahzad Shafique"
}
],
"references": [
{
"name": "Microsoft 365 Copilot extensibility",
"description": "Learn more about Microsoft 365 Copilot and how you can extend it.",
"url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/"
},
{
"name": "Build declarative agents for Microsoft 365 Copilot",
"description": "Learn more about declarative agents for Microsoft 365 Copilot.",
"url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-declarative-agent"
},
{
"name": "Dynamics 365 documentation",
"description": "Official Dynamics 365 documentation and best practices.",
"url": "https://learn.microsoft.com/dynamics365/"
},
{
"name": "Power Platform documentation",
"description": "Learn about Power Apps, Power Automate, and Copilot Studio.",
"url": "https://learn.microsoft.com/power-platform/"
}
]
}
]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions samples/da-dynamics365-advisor/env/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file includes environment variables that will be committed to git by default.

# Built-in environment variables
TEAMSFX_ENV=dev
APP_NAME_SUFFIX=dev
AGENT_SCOPE=shared

# Updating AZURE_SUBSCRIPTION_ID or AZURE_RESOURCE_GROUP_NAME after provision may also require an update to RESOURCE_SUFFIX, because some services require a globally unique name across subscriptions/resource groups.
AZURE_SUBSCRIPTION_ID=
AZURE_RESOURCE_GROUP_NAME=
RESOURCE_SUFFIX=

Comment thread
MrShahzadShafique marked this conversation as resolved.
# Generated during provision, you can also add your own variables.
TEAMS_APP_ID=
M365_TITLE_ID=
M365_APP_ID=
Loading
Loading