Skip to content

Latest commit

 

History

History
89 lines (61 loc) · 5.19 KB

File metadata and controls

89 lines (61 loc) · 5.19 KB

Browse the menu and place an order at a local Italian restaurant using Microsoft 365 Copilot, Dev Proxy and API key authentication

Summary

This sample demonstrates how to build a declarative agent for Microsoft 365 Copilot that allows you to browse a menu of a local Italian restaurant and place an order. The agent uses an API plugin to connect to an API secured with an API key. Dev Proxy is used to simulate the API, so you don't need to build or maintain a real backend. This is useful when the API doesn't exist yet, is owned by a third party, or you want to avoid writing code that won't ship.

Declarative agent showing what's on the menu for lunch Declarative agent ordering lunch Visual Studio Code with Dev Proxy running and dev tunnel connected

How it works

Microsoft 365 Copilot runs in the cloud and needs a publicly accessible API endpoint. Dev Proxy simulates the API on your machine, and a dev tunnel exposes it over the internet so Copilot can reach it. No API infrastructure is deployed — the simulated API runs entirely on your local machine.

sequenceDiagram
    participant Copilot as Microsoft 365 Copilot
    participant Vault as Teams Vault
    participant Tunnel as Dev Tunnel
    participant Proxy as Dev Proxy
    Copilot->>Vault: Get API key
    Vault->>Copilot: API key
    Copilot->>Tunnel: API request with API key (internet)
    Note over Tunnel: Rewrites host header<br/>to api.ristorante.com
    Tunnel->>Proxy: Forward to localhost:8000
    Note over Proxy: Validates API key
    Proxy->>Tunnel: Simulated response
    Tunnel->>Copilot: Response (internet)
Loading

Features

This sample illustrates the following concepts:

  • Building a declarative agent for Microsoft 365 Copilot with an API plugin
  • Connecting an API plugin to an API secured with an API key
  • Using Dev Proxy to simulate a CRUD API secured with an API key locally
  • Using dev tunnels to expose the local API over the internet for use with Microsoft 365 Copilot

Contributors

Version history

Version Date Comments
1.1 June 16, 2026 Updated Dev Proxy schemas to v3.0.1
1.0 May 14, 2026 Initial release

Prerequisites

Minimal path to awesome

  • Clone this repository (or download this solution as a .ZIP file then unzip it)
  • 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
  • When prompted for the API key, enter devproxyrules

Testing the API

You can test the API directly using the api.http file included in the project root. This requires the REST Client extension. With the debug session running, open the file and use the Send Request links above each request to test the API endpoints through the dev tunnel.

Note: The api.http file uses a .env symlink in the project root that points to env/.env.local. This symlink is created automatically when you start a debug session.

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.