diff --git a/README.md b/README.md index 58c58b92c..87fca809f 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/samples/da-dynamics365-advisor/.env.local.sample b/samples/da-dynamics365-advisor/.env.local.sample new file mode 100644 index 000000000..00fc7bd7f --- /dev/null +++ b/samples/da-dynamics365-advisor/.env.local.sample @@ -0,0 +1,6 @@ +# Sample environment file for Dynamics 365 Advisor Agent +# Copy this to env/.env.local and fill in your values +# DO NOT commit .env.local to git! + +# Teams Toolkit Environment +TEAMSFX_ENV=local diff --git a/samples/da-dynamics365-advisor/.gitignore b/samples/da-dynamics365-advisor/.gitignore new file mode 100644 index 000000000..788347728 --- /dev/null +++ b/samples/da-dynamics365-advisor/.gitignore @@ -0,0 +1,14 @@ +# TeamsFx files +env/.env.*.user +env/.env.local +.env.local +.localConfigs +appPackage/build + +# dependencies +node_modules/ + +# misc +.env +.deployment +.DS_Store diff --git a/samples/da-dynamics365-advisor/README.md b/samples/da-dynamics365-advisor/README.md new file mode 100644 index 000000000..fa815d119 --- /dev/null +++ b/samples/da-dynamics365-advisor/README.md @@ -0,0 +1,59 @@ +# 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) + +## Features + +This sample illustrates the following concepts: + +* **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 + +## Contributors + +* [Muhammad Shahzad Shafique](https://github.com/MrShahzadShafique) + +## Version history + +Version|Date|Comments +-------|----|----| +1.0.0|April 28, 2026|Initial release + +## Prerequisites + +* Microsoft 365 tenant with Microsoft 365 Copilot +* [Visual Studio Code](https://code.visualstudio.com/) with the [Microsoft 365 Agents Toolkit](https://marketplace.visualstudio.com/items?itemName=TeamsDevApp.ms-teams-vscode-extension) extension +* [Node.js v18](https://nodejs.org/en/download/package-manager) + +## 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) +* From your command line, change your current directory to the `samples/da-dynamics365-advisor` folder +* In the command line, run: `copy .env.local.sample env\.env.local` +* Open the Microsoft 365 Agents Toolkit extension and sign in to your Microsoft 365 tenant with Microsoft 365 Copilot +* Select **Debug in Copilot (Edge)** from the launch configuration dropdown + +## Help + +We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues. + +You can try looking at [issues related to this sample](https://github.com/pnp/copilot-pro-dev-samples/issues?q=label%3A%22sample%3A%20da-dynamics365-advisor%22) to see if anybody else is having the same issues. + +If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/copilot-pro-dev-samples/issues/new). + +Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/copilot-pro-dev-samples/issues/new). + +## 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.** + + diff --git a/samples/da-dynamics365-advisor/appPackage/color.png b/samples/da-dynamics365-advisor/appPackage/color.png new file mode 100644 index 000000000..11e255fa0 Binary files /dev/null and b/samples/da-dynamics365-advisor/appPackage/color.png differ diff --git a/samples/da-dynamics365-advisor/appPackage/declarativeAgent.json b/samples/da-dynamics365-advisor/appPackage/declarativeAgent.json new file mode 100644 index 000000000..8fc111d46 --- /dev/null +++ b/samples/da-dynamics365-advisor/appPackage/declarativeAgent.json @@ -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?" + } + ] +} \ No newline at end of file diff --git a/samples/da-dynamics365-advisor/appPackage/instruction.txt b/samples/da-dynamics365-advisor/appPackage/instruction.txt new file mode 100644 index 000000000..ce1be2c75 --- /dev/null +++ b/samples/da-dynamics365-advisor/appPackage/instruction.txt @@ -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 \ No newline at end of file diff --git a/samples/da-dynamics365-advisor/appPackage/manifest.json b/samples/da-dynamics365-advisor/appPackage/manifest.json new file mode 100644 index 000000000..cc3a57eb7 --- /dev/null +++ b/samples/da-dynamics365-advisor/appPackage/manifest.json @@ -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": "declarativeAgent", + "file": "declarativeAgent.json" + } + ] + }, + "permissions": [ + "identity" + ], + "validDomains": [] +} \ No newline at end of file diff --git a/samples/da-dynamics365-advisor/appPackage/outline.png b/samples/da-dynamics365-advisor/appPackage/outline.png new file mode 100644 index 000000000..f7a4c8644 Binary files /dev/null and b/samples/da-dynamics365-advisor/appPackage/outline.png differ diff --git a/samples/da-dynamics365-advisor/assets/sample.json b/samples/da-dynamics365-advisor/assets/sample.json new file mode 100644 index 000000000..41a61daef --- /dev/null +++ b/samples/da-dynamics365-advisor/assets/sample.json @@ -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/" + } + ] + } +] diff --git a/samples/da-dynamics365-advisor/assets/screenshot.png b/samples/da-dynamics365-advisor/assets/screenshot.png new file mode 100644 index 000000000..3eb4373bf Binary files /dev/null and b/samples/da-dynamics365-advisor/assets/screenshot.png differ diff --git a/samples/da-dynamics365-advisor/env/.env.dev b/samples/da-dynamics365-advisor/env/.env.dev new file mode 100644 index 000000000..2419a4f1c --- /dev/null +++ b/samples/da-dynamics365-advisor/env/.env.dev @@ -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= + +# Generated during provision, you can also add your own variables. +TEAMS_APP_ID= +M365_TITLE_ID= +M365_APP_ID= diff --git a/samples/da-dynamics365-advisor/m365agents.yml b/samples/da-dynamics365-advisor/m365agents.yml new file mode 100644 index 000000000..fd922f06d --- /dev/null +++ b/samples/da-dynamics365-advisor/m365agents.yml @@ -0,0 +1,85 @@ +# yaml-language-server: $schema=https://aka.ms/m365-agents-toolkits/v1.11/yaml.schema.json +# Visit https://aka.ms/teamsfx-v5.0-guide for details on this file +# Visit https://aka.ms/teamsfx-actions for details on actions +version: v1.11 + +additionalMetadata: + sampleTag: pnp-copilot-pro-dev:da-dynamics365-advisor + +environmentFolderPath: ./env + +# Triggered when 'teamsapp provision' is executed +provision: + # Creates an app + - uses: teamsApp/create + with: + # app name + name: Dynamics 365 Advisor-${{APP_NAME_SUFFIX}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + teamsAppId: TEAMS_APP_ID + + # Build app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Update the app manifest to an existing app in Developer Portal. + # Will use the app id in manifest file to determine which app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Extend your app to Outlook and the Microsoft 365 app + - uses: teamsApp/extendToM365 + with: + # Relative path to the build app package. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + scope: ${{AGENT_SCOPE}} + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + titleId: M365_TITLE_ID + appId: M365_APP_ID + shareLink: SHARE_LINK + +# Triggered when 'teamsapp publish' is executed +publish: + # Build app package with latest env value + - uses: teamsApp/zipAppPackage + with: + # Path to manifest template + manifestPath: ./appPackage/manifest.json + outputZipPath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + outputFolder: ./appPackage/build + # Validate app package using validation rules + - uses: teamsApp/validateAppPackage + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Apply the app manifest to an existing app in + # Developer Portal. + # Will use the app id in manifest file to determine which app to update. + - uses: teamsApp/update + with: + # Relative path to this file. This is the path for built zip file. + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Publish the app to + # Teams Admin Center (https://admin.teams.microsoft.com/policies/manage-apps) + # for review and approval + - uses: teamsApp/publishAppPackage + with: + appPackagePath: ./appPackage/build/appPackage.${{TEAMSFX_ENV}}.zip + # Write the information of created resources into environment file for + # the specified environment variable(s). + writeToEnvironmentFile: + publishedAppId: TEAMS_APP_PUBLISHED_APP_ID +projectId: 0a70453a-f5b2-4a99-94d2-adf9b270fb22