Skip to content

Commit bc6372c

Browse files
authored
Merge pull request #87631 from LisaLeib/lisaleib-ks
Lisaleib ks
2 parents 63d1359 + 64d3a3b commit bc6372c

23 files changed

+335
-185
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,11 @@
17801780
"redirect_url": "/azure/search/search-get-started-postman",
17811781
"redirect_document_id": false
17821782
},
1783+
{
1784+
"source_path": "articles/search/knowledge-store-connect-powerbi.md",
1785+
"redirect_url": "/azure/search/knowledge-store-create-portal",
1786+
"redirect_document_id": true
1787+
},
17831788
{
17841789
"source_path": "articles/search/search-create-index-rest-api.md",
17851790
"redirect_url": "/azure/search/search-get-started-powershell",

articles/search/TOC.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,14 @@
241241
href: cognitive-search-resources-documentation.md
242242
- name: Knowledge store (preview)
243243
items:
244-
- name: Connect using Power BI
245-
href: knowledge-store-connect-powerbi.md
244+
- name: Create a knowledge store in Azure portal
245+
href: knowledge-store-create-portal.md
246246
- name: Create using REST and Postman
247247
href: knowledge-store-howto.md
248+
- name: View with Storage Explorer
249+
href: knowledge-store-view-storage-explorer.md
250+
- name: Connect with Power BI
251+
href: knowledge-store-connect-power-bi.md
248252
- name: Query data
249253
items:
250254
- name: Create a basic query
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: 'Connect to a knowledge store with Power BI - Azure Search'
3+
description: Connect an Azure Search knowledge store with Power BI for analysis and exploration.
4+
5+
author: lisaleib
6+
services: search
7+
ms.service: search
8+
ms.subservice: cognitive-search
9+
ms.topic: tutorial
10+
ms.date: 09/03/2019
11+
ms.author: v-lilei
12+
13+
---
14+
# Connect a knowledge store with Power BI
15+
16+
> [!Note]
17+
> Knowledge store is in preview and should not be used in production. The [Azure Search REST API version 2019-05-06-Preview](search-api-preview.md) provides this feature. There is no .NET SDK support at this time.
18+
>
19+
In this article, you'll learn how to connect and explore a knowledge store using Power Query in the Power BI Desktop app. To create the knowledge store sample used in this walkthrough, see [Create a knowledge store in Azure portal](knowledge-store-create-portal.md).
20+
21+
## Prerequisites
22+
23+
+ Follow the steps in [Create a knowledge store in the Azure portal](knowledge-store-create-portal.md) to create the sample knowledge store used in this walkthrough. You will also need the name of the Azure storage account that you used to create the knowledge store, along with its access key from the Azure portal.
24+
25+
+ [Install Power BI Desktop](https://powerbi.microsoft.com/downloads/)
26+
27+
## Connect with Power BI
28+
29+
1. Start Power BI Desktop and click **Get data**.
30+
31+
1. In the **Get Data** window, select **Azure**, and then select **Azure Table Storage**.
32+
33+
1. Click **Connect**.
34+
35+
1. For **Account Name or URL**, enter in your Azure Storage account name (the full URL will be created for you).
36+
37+
1. If prompted, enter the storage account key.
38+
39+
1. Select the *hotelReviewsSsDocument*, *hotelReviewsSsKeyPhrases*, and *hotelReviewsSsPages* tables. These tables are Azure table projections of the hotel reviews sample data and include the cognitive service enrichments that were selected when the knowledge store was created.
40+
41+
1. Click **Load**.
42+
43+
1. On the top ribbon, click **Edit Queries** to open the **Power Query Editor**.
44+
45+
![Open Power Query](media/knowledge-store-connect-power-bi/powerbi-edit-queries.png "Open Power Query")
46+
47+
1. Select *hotelReviewsSsDocument*, and then remove the *PartitionKey*, *RowKey*, and *Timestamp* columns.
48+
49+
![Edit tables](media/knowledge-store-connect-power-bi/powerbi-edit-table.png "Edit tables")
50+
51+
1. Click the icon with opposing arrows at the upper right side of the table to expand the *Content*. When the list of columns appears, select all columns, and then deselect columns that start with 'metadata'. Click **OK** to show the selected columns.
52+
53+
![Edit tables](media/knowledge-store-connect-power-bi/powerbi-expand-content-table.png "Expand content")
54+
55+
1. Change the data type for the following columns by clicking the ABC-123 icon at the top left of the column.
56+
57+
+ For *content.latitude* and *Content.longitude*, select **Decimal Number**.
58+
+ For *Content.reviews_date* and *Content.reviews_dateAdded*, select **Date/Time**.
59+
60+
![Change data types](media/knowledge-store-connect-power-bi/powerbi-change-type.png "Change data types")
61+
62+
1. Select *hotelReviewsSsPages*, and then repeat steps 9 and 10 to delete the columns and expand the *Content*.
63+
1. Change the data type for *Content.SentimentScore* to **Decimal Number**.
64+
1. Select *hotelReviewsSsKeyPhrases* and repeat steps 9 and 10 to delete the columns and expand the *Content*. There are no data type modifications for this table.
65+
66+
1. On the command bar, click **Close and Apply**.
67+
68+
1. Click on the Model tile on the left navigation pane and validate that Power BI shows relationships between all three tables.
69+
70+
![Validate relationships](media/knowledge-store-connect-power-bi/powerbi-relationships.png "Validate relationships")
71+
72+
1. Double-click each relationship and make sure that the **Cross-filter direction** is set to **Both**. This enables your visuals to refresh when a filter is applied.
73+
74+
<!-- ## Try with larger data sets
75+
76+
We purposely kept the data set small to avoid charges for a demo walkthrough. For a more realistic experience, you can create and then attach a billable Cognitive Services resource to enable a larger number of transactions against the sentiment analyzer, keyphrase extraction, and language detector skills.
77+
78+
Create new containers in Azure Blob storage and upload each CSV file to its own container. Specify one of these containers in the data source creation step in Import data wizard.
79+
80+
| Description | Link |
81+
|-------------|------|
82+
| Free tier | [HotelReviews_Free.csv](https://knowledgestoredemo.blob.core.windows.net/hotel-reviews/HotelReviews_Free.csv?st=2019-07-29T17%3A51%3A30Z&se=2021-07-30T17%3A51%3A00Z&sp=rl&sv=2018-03-28&sr=c&sig=LnWLXqFkPNeuuMgnohiz3jfW4ijePeT5m2SiQDdwDaQ%3D) |
83+
| Small (500 Records) | [HotelReviews_Small.csv](https://knowledgestoredemo.blob.core.windows.net/hotel-reviews/HotelReviews_Small.csv?st=2019-07-29T17%3A51%3A30Z&se=2021-07-30T17%3A51%3A00Z&sp=rl&sv=2018-03-28&sr=c&sig=LnWLXqFkPNeuuMgnohiz3jfW4ijePeT5m2SiQDdwDaQ%3D) |
84+
| Medium (6000 Records)| [HotelReviews_Medium.csv](https://knowledgestoredemo.blob.core.windows.net/hotel-reviews/HotelReviews_Medium.csv?st=2019-07-29T17%3A51%3A30Z&se=2021-07-30T17%3A51%3A00Z&sp=rl&sv=2018-03-28&sr=c&sig=LnWLXqFkPNeuuMgnohiz3jfW4ijePeT5m2SiQDdwDaQ%3D)
85+
| Large (Full dataset 35000 Records) | [HotelReviews_Large.csv](https://knowledgestoredemo.blob.core.windows.net/hotel-reviews/HotelReviews_Large.csv?st=2019-07-29T17%3A51%3A30Z&se=2021-07-30T17%3A51%3A00Z&sp=rl&sv=2018-03-28&sr=c&sig=LnWLXqFkPNeuuMgnohiz3jfW4ijePeT5m2SiQDdwDaQ%3D). Be aware that very large data sets are expensive to process. This one costs roughly $1000 U.S dollars.|
86+
87+
In the enrichment step of the wizard, attach a billable [Cognitive Services](https://docs.microsoft.com/azure/cognitive-services/cognitive-services-apis-create-account) resource, created at the *S0* tier, in the same region as Azure Search to use larger data sets.
88+
89+
![Create a Cognitive Services resource](media/knowledge-store-connect-power-bi/create-cognitive-service.png "Create a Cognitive Services resource") -->
90+
91+
## Clean up
92+
93+
When you're working in your own subscription, it's a good idea at the end of a project to identify whether you still need the resources you created. Resources left running can cost you money. You can delete resources individually or delete the resource group to delete the entire set of resources.
94+
95+
You can find and manage resources in the portal, using the **All resources** or **Resource groups** link in the left-navigation pane.
96+
97+
If you are using a free service, remember that you are limited to three indexes, indexers, and data sources. You can delete individual items in the portal to stay under the limit.
98+
99+
## Next steps
100+
101+
To learn how to explore this knowledge store using Storage Explorer, see the following article.
102+
103+
> [!div class="nextstepaction"]
104+
> [View with Storage Explorer](knowledge-store-view-storage-explorer.md)
105+
106+
To learn how to create a knowledge store using the REST APIs and Postman, see the following article.
107+
108+
> [!div class="nextstepaction"]
109+
> [Create a knowledge store in REST](knowledge-store-howto.md)

0 commit comments

Comments
 (0)