SharePoint Agents Finder uses the Microsoft Graph API as a Copilot plugin in a declarative agent, leveraging the Microsoft Graph Search API /search/query endpoint to retrieve information about SharePoint Agents and event any file in Microsoft 365. It helps end users or IT Admins get info about SharePoint Agents in SharePoint or find files in Microsoft 365 using Graph API Search!
- Mohammad Amer - M365 Development MVP
Version | Date | Comments |
---|---|---|
1.0 | March 24, 2025 | Initial solution |
1.0 | March 25, 2025 | Updated README with Prerequisites and Minimal path to awesome |
-
Entra ID App Registration:
- Register an Entra ID application.
- Assign the Graph API permissions:
Files.Read.All
as delegated permissions. - Retrieve the
ClientId
,ClientSecret
, andTenantID
. - Add the https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect as a redirect URL for web platform in the Authentication settings.
-
Teams developer portal:
-
Add a new OAuth client registration
-
Register a new client with the following information
- Registration name: da-sharepoint-agents-finder
- Base URL: https://graph.microsoft.com/v1.0
- Restrict usage by org: My organization only
- Restrict usage by app: Any Teams app (when agent is deployed, use the Teams app ID).
-
OAuth settings
- Client ID:
- Client secret:
- Authorization endpoint
(replace tenantid by your own value)
: https://login.microsoftonline.com/tenantid/oauth2/v2.0/authorize - Token endpoint
(replace tenantid by your own value)
: https://login.microsoftonline.com/tenantid/oauth2/v2.0/token - Refresh endpoint
(replace tenantid by your own value)
: https://login.microsoftonline.com/tenantid/oauth2/v2.0/refresh - Scope: Files.Read.All
- Save the information.
- A new OAuth registration key will be generated. Save it in secure place to be added in
.env.dev
-
How to run this sample:
To run this app template in your local dev machine, you will need:
- Node.js, supported versions: 18, 20
- A Microsoft 365 account for development.
- Teams Toolkit Visual Studio Code Extension version 5.0.0 and higher or Teams Toolkit CLI
- Microsoft 365 Copilot license
- First, select the Teams Toolkit icon on the left in the VS Code toolbar.
- In the Account section, sign in with your Microsoft 365 account if you haven't already.
- Create Teams app by clicking
Provision
in "Lifecycle" section. - Select
Preview in Copilot (Edge)
orPreview in Copilot (Chrome)
from the launch configuration dropdown. - Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent.
- Ask a question to your declarative agent and it should respond based on the instructions provided.
Folder | Contents |
---|---|
.vscode |
VSCode files for debugging |
appPackage |
Templates for the Teams application manifest, the GPT manifest and the API specification |
env |
Environment files |
The following files can be customized and demonstrate an example implementation to get you started.
File | Contents |
---|---|
appPackage/declarativeAgent.json |
Define the behaviour and configurations of the declarative agent. |
appPackage/manifest.json |
Teams application manifest that defines metadata for your declarative agent. |
The following are Teams Toolkit specific project files. You can visit a complete guide on Github to understand how Teams Toolkit works.
File | Contents |
---|---|
teamsapp.yml |
This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |
-
Clone the Repository:
- Clone this repository to your local machine.
-
Navigate to Solution Folder:
- Ensure you are in the solution folder of the cloned repository.
-
Update graphsearchplugin-openapi.yml:
- Ensure you open this file
appPackage\graphsearchplugin-openapi.yml
and update thetenantid
with your tenant Id.
securitySchemes: azureaadv2: type: oauth2 flows: authorizationCode: authorizationUrl: https://login.microsoftonline.com/tenantid/oauth2/v2.0/authorize tokenUrl: https://login.microsoftonline.com/tenantid/oauth2/v2.0/token
- Ensure you open this file
-
Update .env.dev file:
- Ensure you open this file and update this
OAUTH2_REGISTRATIONKEY
key with OAuth registration key generated in the prerequisites
- Ensure you open this file and update this
- Interactive Chat experience: The SharePoint Agents Finder declarative agent offers a seamless and interactive chat experience within the Microsoft 365 Copilot chat interface.
- Graph API Integration: Utilizes the Microsoft Graph API as a Copilot plugin in a declarative agent.
- Querying Microsoft 365 and SharePoint content: Querying Microsoft 365 and SharePoint content delivering structured responses in table format with links to files.
- SharePoint Agents Finder or SharePoint Agents doc finder: As long as the agent utilizes the Microsoft Graph API search then it could find not only SharePoint Agents but also any document in Microsoft 365.
- Table of Responses: Table of Responses is a potential improvement that could be improved through the instructions
- SharePoint Agent Link: SharePoint Agent Link should be improved to either direct you to the agent or the link of the agent should appear in the SiteAssets library.