Task 04: Deploy and test the declarative agent
Introduction
Before go‑live, Best For You Organics must confirm Copilot can retrieve live ticket data via the new plugin.
Description
In this task you will provision the CopilotWithPlugin package to the tenant, open Copilot chat with that app selected, and execute a query that retrieves ticket data through the newly registered plugin.
Success criteria
- CopilotWithPlugin is provisioned and selectable in Copilot chat.
- The command “Give me the list of tickets assigned to Matteo Pagani” returns accurate ticket data with references.
Key steps
01: Provision the app
Expand this section to view the solution
-
Open a new window in Visual Studio Code.
-
In the left pane, select Microsoft 365 Agents Toolkit. Expand the DEVELOPMENT node and then select Create New App.
-
Select Copilot Agent, then Declarative agent, and then select Add plugin.
-
Select Start with an OpenAPI Description Document.
-
Select Enter OpenAPI Description Document Location or Open File and then select Enter OpenAPI Description Document Location.
-
In the OpenAPI Description Document field, paste the following URL and select Enter.
https://ticket-copilot.azurewebsites.net/api/swagger.json
-
Select the GET and POST check boxes and then select OK.
-
In the Workspace Folder dialog, select Default folder C:\Users\Admin\AgentsToolkitProjects.
-
Enter CopilotWithPlugin as the application name and select Enter. Visual Studio Code opens.
-
Select Yes, I trust the authors.
-
In Visual Studio Code, in the left pane, select appPackage.
-
Expand the LIFECYCLE node and then select Provision.
This action deploys the agent with the plugin to Microsoft 365.
02: Query tickets via Copilot
Expand this section to view the solution
-
Open a new browser tab and go to Microsoft 365 Copilot. If prompted, sign in using your credentials.
-
In the left pane, select CopilotWithPlugin.
-
Enter the following in the Copilot prompt to test the plugin and select Enter:
Give me the list of tickets assigned to Matteo Pagani.
If prompted, select Always allow.
-
Review the response.
-
Notice that the response starts with the text you added to the instruction.txt file.
-
Notice the ticket information is accurate.
-
Notice the reference links to data source pages.
-
-
Enter the following prompt and press Enter on your keyboard:
-developer on
This command enables developer mode. While you are in developer mode, you can access additional information about operations.
-
Re-run the previous prompt and press Enter on your keyboard.
Give me the list of tickets assigned to Matteo Pagani.
A new pane displays with options for viewing the additional information.