Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Use the Microsoft Graph API as a Copilot plugin for a declarative agent to get ToDo tasks

Summary

This sample demonstrates how to use the Microsoft Graph API as a Copilot plugin in a declarative agent with some variation from the blog post https://blog.franckcornu.com/post/copilot-graph-api-qna-plugin/ focusing this time how to list and create my To-Do tasks since the QnA feature has retired since March 2025.

The following blog post describes the complete solution setup:Building a Copilot Agent with Teams Toolkit and Microsoft Graph Plugin to list my ToDo Tasks

List/Retrieve my To-Do Tasks

"Graph API To-Do List Tasks "

Create my To-Do Tasks

"Graph API To-Do Create Tasks "

Contributors

Version history

Version Date Comments
1.0 April 18, 2025 Initial solution
2.0 May 18, 2025 Added action to create my To-Do task

Get started with the template

Prerequisites

To run this app template in your local dev machine, you will need:

Minimal path to awesome

  • Clone this repository (or download this solution as a .ZIP file then unzip it)

  • Register an Entra ID application in Azure and add the API permissions Tasks.ReadWrite,User.Read,Directory.Read.All (delegated). Add the https://teams.microsoft.com/api/platform/v1.0/oAuthRedirect as a redirect URL for web platform in the Authentication settings.

  1. In the Teams developer portal, add a new OAuth client registration and register a new client with the following information (replace tenantid by your own value):

    App settings

    • Registration name: ToDo
    • Base URL: https://graph.microsoft.com/beta (QnA are only usable through the beta endpoint)
    • 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

    Save the information. A new OAuth registration key will be generated.

  2. Open the ai-plugin.json file and replace the auth property by the following, using the key from the previous step. You can also use the ${{OAUTH2_REGISTRATIONKEY}} token defined the .env.dev file:

"auth": {
    "type": "OAuthPluginVault",
    "reference_id": "ZTRhNDM5YjQtM2..."
},
  1. From Teams Toolkit, sign-in to your Microsoft 365 account.
  2. From Teams Toolkit, provision the solution to create the Teams app.
  3. Go to https://www.office.com/chat?auth=2 URL and enable the developer mode by using the -developer on prompt.
  4. Ask a question like "List My Tasks". You should see the plugin triggered.

Features

The following sample demonstrates the following concepts:

  • Use Microsoft Graph API as an API plugin by using specific endpoint and instructions.
  • Query the QnA content from Microsoft Search and use it for Copilot answers.

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 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.

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.