Trey Research is a fictitious consulting company that supplies talent in the software and pharmaceuticals industries.
The solution consists of an API plugin that calls a set of Azure functions, which store the consulting data in a Azure Table storage (it uses the Azurite storage emulator when running locally).
A declarative agent is provided to converse with users and to call the API plugin, as well as to reference the correct SharePoint document library.
The sample showcases the following features:
- Declarative agent with branding and instructions, with access to relevant documents and an API
- API based plugin works with any platform that supports REST requests
- Copilot will construct queries for specific data using GET requests
- Copilot updates and adds data using POST requests
- Multi-parameter queries to filter results
- Show a confirmation card before POSTing data; capture missing parameters
- Display rich adaptive cards
- Authenticate the user using Entra ID and OAuth 2.0
| Version | Date | Comments |
|---|---|---|
| 1.1 | June 11, 2025 | Maintenance release |
| 1.0 | April 16, 2025 | Initial release |
- Node.js
- A Microsoft 365 tenant prepared for development
- Microsoft 365 Agents Toolkit Visual Studio Code extension
- A Microsoft 365 Copilot licence
For this sample, we will use OneDrive to store the documents that the agent will reference.
![NOTE] You can also use SharePoint document libraries, the URL will be slightly different, but the process is the same.
- Go to OneDrive
- Go to My files
- Create a new folder called Legal
- Upload documents from the sampleDocs folder in this repository to the Legal folder
- Navigate to the Legal folder
- Expand the Details tab on the right
- Expand the More details tab
- Copy the Path to the Products folder using the Copy button
-
In the .env folder, create a new file called .env.local.
-
Add the following line to the .env.local file:
DOCUMENTS_URL=<paste the path you copied from OneDrive>For example, if you copied the path
https://contoso-my.sharepoint.com/personal/user_contoso_com/Documents/Legal, it should look like this:DOCUMENTS_URL=https://contoso-my.sharepoint.com/personal/user_contoso_com/Documents/Legal -
Press F5 to start a debug session. If prompted, sign in with your Microsoft 365 account. Wait for the provisioning to complete and the browser to open.
-
In the browser, if prompted, sign in with your Microsoft 365 account. The browser will open the declarative agent in Microsoft 365 Copilot after signing in.
![IMPORTANT] Microsoft 365 Copilot can cache the agent definition, so if you make changes to the agent, you may need to clear the browser cache for changes to be persisted. After the agent is loaded, use Hard Refresh (Ctrl+Shift+R) to ensure the latest version is loaded.
Try the following prompts:
- do we have any consultants with azure certifications?
- what projects are we doing for relecloud?
- which consultants are working with woodgrove bank?
- how many hours has avery delivered this month?
- please find a consultant with python skills who is available immediately
- are any consultants available who are AWS certified?
- does trey research have any architects with javascript skills?
- what designers are working at woodgrove bank?
- please charge 10 hours to woodgrove bank
- please add sanjay to the contoso project
- find my hours spreadsheet and get the hours for woodgrove, then bill the client
- make a list of my projects, then write a summary of each based on the statement of work.
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 to see if anybody else is having the same issues.
If you encounter any issues using this sample, create a new issue.
Finally, if you have an idea for improvement, make a suggestion.
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.
