Skip to content

Commit f9bbbf5

Browse files
committed
edit for pub
1 parent 0aa8975 commit f9bbbf5

File tree

2 files changed

+196
-5
lines changed

2 files changed

+196
-5
lines changed

articles/ai-services/.openpublishing.redirection.ai-services.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,11 +2764,6 @@
27642764
"source_path_from_root": "/articles/ai-services/openai/whisper-quickstart.md",
27652765
"redirect_url": "/azure/ai-foundry/openai/whisper-quickstart",
27662766
"redirect_document_id": true
2767-
},
2768-
{
2769-
"source_path_from_root": "/articles/ai-services/qnamaker/tutorials/integrate-with-power-virtual-assistant-fallback.md",
2770-
"redirect_url": "/azure/ai-services/language-service/tutorials/power-automate",
2771-
"redirect_document_id": true
27722767
}
27732768

27742769
]
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
---
2+
title: "Tutorial: Integrate with Copilot Studios - QnA Maker"
3+
description: In this tutorial, improve the quality of your knowledge base with active learning. Review, accept or reject, or add without removing or changing existing questions.
4+
ms.service: azure-ai-language
5+
manager: nitinme
6+
ms.author: lajanuar
7+
author: laujan
8+
ms.subservice: azure-ai-qna-maker
9+
ms.topic: tutorial
10+
ms.date: 07/16/2025
11+
---
12+
13+
# Tutorial: Add your knowledge base to Copilot Studios
14+
15+
Create and extend a [Copilot Studios](https://azure.microsoft.com/products/copilot-studio) bot to provide answers from your knowledge base.
16+
17+
> [!NOTE]
18+
> The integration demonstrated in this tutorial is in preview and isn't intended for deployment to production environments.
19+
20+
In this tutorial, you learn how to:
21+
22+
> [!div class="checklist"]
23+
>
24+
> * Create a Power Virtual agents bot
25+
> * Create a system fallback topic
26+
> * Add QnA Maker as an action to a topic as a Power Automate flow
27+
> * Create a Power Automate solution
28+
> * Add a Power Automate flow to your solution
29+
> * Publish Power Virtual agents
30+
> * Test Power Virtual agents, and recieve an answer from your QnA Maker knowledge base
31+
32+
[!INCLUDE [Custom question answering](../includes/new-version.md)]
33+
34+
## Create and publish a knowledge base
35+
36+
1. Follow the [quickstart](../quickstarts/create-publish-knowledge-base.md) to create a knowledge base. Don't complete the last section, about creating a bot. Instead, use this tutorial to create a bot with Copilot Studios.
37+
38+
> [!div class="mx-imgBorder"]
39+
> ![Screenshot of published knowledge base settings](../media/how-to-integrate-power-virtual-agent/published-knowledge-base-settings.png)
40+
41+
Enter your published knowledge base settings found on the **Settings** page in the QnA Maker portal. You need this information for the [Power Automate step](#create-a-power-automate-flow-to-connect-to-your-knowledge-base) to configure your QnA Maker `GenerateAnswer` connection.
42+
43+
1. In the QnA Maker portal, on the **Settings** page, find the endpoint key, endpoint host, and knowledge base ID.
44+
45+
## Create bot in Copilot Studios
46+
47+
[Copilot Studios](https://azure.microsoft.com/products/copilot-studio) allows teams to create powerful bots by using a guided, no-code graphical interface. You don't need data scientists or developers.
48+
49+
Create a bot by following the steps in [Create and delete Copilot Studios bots](/power-virtual-agents/authoring-first-bot).
50+
51+
## Create the system fallback topic
52+
53+
In Copilot Studios, you create a bot with a series of topics (subject areas), in order to answer user questions by performing actions.
54+
55+
Although the bot can connect to your knowledge base from any topic, this tutorial uses the *system fallback* topic. The fallback topic is used when the bot can't find an answer. The bot passes the user's text to QnA Maker's `GenerateAnswer` API, receives the answer from your knowledge base, and displays it to the user as a message.
56+
57+
Create a fallback topic by following the steps in [Configure the system fallback topic in Copilot Studios](/power-virtual-agents/authoring-system-fallback-topic).
58+
59+
## Use the authoring canvas to add an action
60+
61+
Use the Copilot Studios authoring canvas to connect the fallback topic to your knowledge base. The topic starts with the unrecognized user text. Add an action that passes that text to QnA Maker, and then shows the answer as a message. The last step of displaying an answer is handled as a [separate step](#add-your-solutions-flow-to-power-virtual-agents), later in this tutorial.
62+
63+
This section creates the fallback topic conversation flow.
64+
65+
1. The new fallback action might already have conversation flow elements. Delete the **Escalate** item by selecting the **Options** menu.
66+
67+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/delete-escalate-action-using-option-menu.png" alt-text="Partial screenshot of conversation flow, with delete option highlighted.":::
68+
69+
1. Above the **Message** node, select the plus (**+**) icon, and then select **Call an action**.
70+
71+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/create-new-item-call-an-action.png" alt-text="Partial Screenshot of Call an action.":::
72+
73+
1. Select **Create a flow**. The process takes you to the Power Automate portal.
74+
75+
> [!div class="mx-imgBorder"]
76+
> ![Screenshot of Create a flow](../media/how-to-integrate-power-virtual-agent/create-a-flow.png)
77+
78+
Power Automate opens to a new template. You don't use this new template.
79+
80+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/power-automate-flow-initial-template.png" alt-text="Partial Screenshot of Power Automate with new flow template.":::
81+
82+
## Create a Power Automate flow to connect to your knowledge base
83+
84+
> [!NOTE]
85+
> Currently the Power Automate template doesn't support QnA Maker managed (Preview) endpoints. Add a QnA Maker managed (Preview) knowledge base to Power Automate by skipping this step and manually adding the endpoints.
86+
The following procedure creates a Power Automate flow that:
87+
88+
* Takes the incoming user text, and sends it to QnA Maker.
89+
* Returns the top response back to your bot.
90+
91+
1. In **Power Automate**, select **Templates** from the left navigation. If you're asked if you want to leave the browser page, accept Leave.
92+
93+
1. On the templates page, search for the template **Generate answer using QnA Maker** then select the template. This template has all the steps to call QnA Maker with your knowledge base settings and return the top answer.
94+
95+
1. On the new screen for the QnA Maker flow, select **Continue**.
96+
97+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/power-automate-qna-flow-template-continue.png" alt-text="Partial Screenshot of QnA Maker template flow with Continue button highlighted.":::
98+
99+
1. Select the **Generate Answer** action box, and fill in your QnA Maker settings from a previous section titled [Create and publish a knowledge base](#create-and-publish-a-knowledge-base). Your **Service Host** in the following image refers to your knowledge base host **Host** and is in the format of `https://YOUR-RESOURCE-NAME.azurewebsites.net/qnamaker`.
100+
101+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/power-virtual-agent-fill-in-generate-answer-settings.png" alt-text="Partial Screenshot of QnA Maker template flow with Generate answer (Preview) highlighted.":::
102+
103+
1. Select **Save** to save the flow.
104+
105+
## Create a solution and add the flow
106+
107+
For the bot to find and connect to the flow, the flow must be included in a Power Automate solution.
108+
109+
1. While still in the Power Automate portal, select **Solutions** from the left-side navigation.
110+
111+
1. Select **+ New solution**.
112+
113+
1. Enter a display name. The list of solutions includes every solution in your organization or school. Choose a naming convention that helps you filter to just your solutions. For example, you might prefix your email to your solution name: `jondoe-power-virtual-agent-qnamaker-fallback`.
114+
115+
1. Select your publisher from the list of choices.
116+
117+
1. Accept the default values for the name and version.
118+
119+
1. Select **Create** to finish the process.
120+
121+
## Add your flow to the solution
122+
123+
1. In the list of solutions, select the solution you created. It should be at the top of the list. If it isn't, search by your email name, which is part of the solution name.
124+
125+
1. In the solution, select **+ Add existing**, and then select **Flow** from the list.
126+
127+
1. Find your flow from the **Outside solutions** list, and then select **Add** to finish the process. If there are many flows, look at the **Modified** column to find the most recent flow.
128+
129+
## Add your solution's flow to Copilot Studios
130+
131+
1. Return to the browser tab with your bot in Copilot Studios. The authoring canvas should still be open.
132+
133+
1. To insert a new step in the flow, above the **Message** action box, select the plus (**+**) icon. Then select **Call an action**.
134+
135+
1. From the **Flow** pop-up window, select the new flow named **Generate answers using QnA Maker knowledge base...**. The new action appears in the flow.
136+
137+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/power-virtual-agent-flow-after-adding-action.png" alt-text="Partial Screenshot of Power platform virtual agent topic conversation canvas after adding QnA Maker flow.":::
138+
139+
1. To correctly set the input variable to the QnA Maker action, select **Select a variable**, then select **bot.UnrecognizedTriggerPhrase**.
140+
141+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/power-virtual-agent-selection-action-input.png" alt-text="Partial Screenshot of Copilot Studios topic conversation canvas selecting input variable.":::
142+
143+
1. To correctly set the output variable to the QnA Maker action, in the **Message** action, select **UnrecognizedTriggerPhrase**, then select the icon to insert a variable, `{x}`, then select **FinalAnswer**.
144+
145+
1. From the context toolbar, select **Save**, to save the authoring canvas details for the topic.
146+
147+
Here's what the final bot canvas looks like.
148+
149+
> [!div class="mx-imgBorder"]
150+
> ![Screenshot shows the final agent canvas with Trigger Phrases, Action, and then Message sections.](../media/how-to-integrate-power-virtual-agent/power-virtual-agent-topic-authoring-canvas-full-flow.png)
151+
152+
## Test the bot
153+
As you design your bot in Copilot Studios, you can use [the Test bot pane](/power-virtual-agents/authoring-test-bot) to see how the bot leads a customer through the bot conversation.
154+
155+
1. In the test pane, toggle **Track between topics**. This view allows you to watch the progression between topics, and within a single topic.
156+
157+
1. Test the bot by entering the user text in the following order. The authoring canvas reports the successful steps with a green check mark.
158+
159+
|Question order|Test questions|Purpose|
160+
|--|--|--|
161+
|1|Hello|Begin conversation|
162+
|2|Store hours|Sample topic. This step is configured for you without any work on your part.|
163+
|3|Yes|In reply to `Did that answer your question?`|
164+
|4|Excellent|In reply to `Please rate your experience.`|
165+
|5|Yes|In reply to `Can I help with anything else?`|
166+
|6|How can I improve the throughput performance for query predictions?|This question triggers the fallback action, which sends the text to your knowledge base to answer. Then the answer is shown. the green check marks for the individual actions indicate success for each action.|
167+
168+
:::image type="content" source="../media/how-to-integrate-power-virtual-agent/power-virtual-agent-test-tracked.png" alt-text="Screenshot of chat bot with canvas indicating green checkmarks for successful actions.":::
169+
170+
## Publish your bot
171+
172+
To make the bot available to all members of your school or organization, you need to *publish* it.
173+
174+
Publish your bot by following the steps in [Publish your bot](/power-virtual-agents/publication-fundamentals-publish-channels).
175+
176+
## Share your bot
177+
178+
To make your bot available to others, you first need to publish it to a channel. For this tutorial, we use the demo website.
179+
180+
Configure the demo website by following the steps in [Configure a chatbot for a live or demo website](/power-virtual-agents/publication-connect-bot-to-web-channels).
181+
182+
Then you can share your website URL with your school or organization members.
183+
184+
## Clean up resources
185+
186+
When you're done with the knowledge base, remove the QnA Maker resources in the Azure portal.
187+
188+
## Next step
189+
190+
[Get analytics on your knowledge base](../how-to/get-analytics-knowledge-base.md)
191+
192+
Learn more about:
193+
194+
* [Copilot Studios](/power-virtual-agents/)
195+
* [Power Automate](/power-automate/)
196+
* [QnA Maker connector](https://us.flow.microsoft.com/connectors/shared_cognitiveservicesqnamaker/qna-maker/) and the [settings for the connector](/connectors/cognitiveservicesqnamaker/)

0 commit comments

Comments
 (0)