Summary
With the rise of Microsoft 365 Copilot, businesses are looking for ways to build AI-powered assistants that seamlessly integrate with Microsoft Teams. A declarative agent is a lightweight, low-code solution that leverages AI Plugins and Adaptive Cards to process user input.
Prerequisites
Before you get started, make sure you have the following:
1
npm install -g @microsoft/teamsfx-cli
- Node.js i am using v20.16.0
- Microsoft 365 Developer Subscription
- Azure Subscription
Step 1: Create a New Declarative Agent in VS Code
- Run the following command in the terminal to create a new project using the Teams Toolkit:
1
2
teamsapp new --capability "declarative-agent" --app-name "Toolkit CLI DA Blog Sample" -folder "ToolkitAgent" --interactive false
--debug --verbose --with-plugin no
- Open project in VS Code
1
2
cd "ToolkitAgent\Toolkit CLI DA Blog Sample"
code .
This will create same structure as using Teams Toolkit in VS Code. From here you can start developing your declarative agent. I have been exploring Microsoft 365 Community (PnP) Copilot Pro Dev scenarios
- Login to M365
1
teamsapp auth login m365
- Package and install the app in Teams
1
2
3
teamsapp package
# Install the app in Teams
teamsapp install --file-path ./appPackage/build/appPackage.dev.zip
you should get response like
1
2
3
4
PS C:\Projects\temp\ToolkitAgent\Toolkit CLI DA Blog Sample> teamsapp install --file-path ./appPackage/build/appPackage.dev.zip
Using YOUR M365 USER
TitleId: U_283c7972-ec29-d062-a3a0-a0e71c5293bc
AppId: 8677e1f5-9757-4814-bf24-6b2a0429d9c9
to see app go to https://m365.cloud.microsoft/chat
Conclusion
I am excited to see how the declarative agent can be used in various scenarios. Personaly, tried very little yet but with amazing samples available in Microsoft 365 Community (PnP) Copilot Pro Dev scenarios it is easy to get started.