|
1 | 1 | # Custom analytics solution for Power Virtual Agents - DataFlows version for higher scale bots |
2 | 2 |
|
3 | | -If your Bot has significant numbers of monthly sessions, using this version of the report provides improved scalibility. This version does require additional setup, and a Power BI Premium license <https://powerbi.microsoft.com/en-us/pricing/>. The report uses Power BI DataFlows to connect to DataVerse and pre-process some of the compute-intensive transformations of the data. |
| 3 | +If your Bot has significant numbers of monthly sessions, using this version of the report provides improved scalibility. This version does require additional setup, management and a Power BI Premium license <https://powerbi.microsoft.com/en-us/pricing/>. The report uses Power BI DataFlows to connect to DataVerse and pre-process some of the compute-intensive transformations of the data. Egress from Dataverse is done using Azure Synapse Link and Azure Data Lake Storage v2. |
| 4 | + |
| 5 | +<img src="img/PVA_Custom_Analytics_Dataflow_SynapseLink.png" width="797" alt="Custom Analytics with Dataflows and Synapse Link - Diagram"> |
4 | 6 |
|
5 | 7 | ## Solution components |
6 | 8 |
|
7 | 9 | - Microsoft Dataverse |
8 | 10 | - Microsoft Power BI DataFlows |
9 | 11 | - Microsoft Power BI Desktop |
10 | | -- Chat Transcripts control for Power BI - available at <https://github.com/iMicknl/powerbi-botframework-chat-transcripts> |
11 | | -- (Optional) Azure Data Lake Storage v2 |
| 12 | +- Chat Transcripts control for Power BI - available at <https://github.com/iMicknl/powerbi-botframework-chat-transcripts> - many thanks to Mick Vleeshouwer |
| 13 | +- Azure Data Lake Storage v2 |
| 14 | + |
| 15 | +## Solution description |
| 16 | + |
| 17 | +This solution is based on 3 key Dataverse tables associate with Power Virtual Agents: |
| 18 | + |
| 19 | +- bot - a list of PVA bots in your environment (small data size) |
| 20 | +- botcomponent - the components making up each bot (e.g. topics) (small data size) |
| 21 | +- conversationtranscript - the log of conversation activity on all your bots (potentially very large data size) |
| 22 | + |
| 23 | +Data in the conversationtranscript table is streamed using Azure Synapse Link from a Dataverse environment to Azure Data Lake Storage v2, stored in the Common Data Model format. A Power BI Dataflow (Dataflow 1) connects to ADLS to retrieve the conversation transcript records. A second Dataflow (Dataflow 2), pre-processes the data, transforming the values stored in the conversationtranscript table into trace data for consumption in the Power BI report. |
12 | 24 |
|
13 | 25 | ## Solution files |
14 | 26 |
|
15 | | -- PVA_Analytics_Export_Transform.json - this is the template for a PowerBI DataFlow |
16 | | -- PVA_Dashboard.pbit - Power BI template file |
| 27 | +- PVA_Analytics_Export_Transform.json - this is the template for a PowerBI DataFlow - provided with an Azure SQL connection for used to retrieve bot info from Dataverse. |
| 28 | +- PVA_Dashboard_DataFlow.pbit - Power BI template file |
17 | 29 |
|
18 | 30 | ## Installation |
19 | 31 |
|
20 | 32 | ### Installation requirements |
21 | 33 |
|
22 | 34 | - One or more Power Virtual Agents bots |
23 | | -- A Power BI account |
| 35 | +- A [Power BI Premium Workspace](https://docs.microsoft.com/en-us/power-bi/admin/service-premium-what-is) |
24 | 36 | - [Power BI Desktop](https://powerbi.microsoft.com/en-us/downloads/) |
25 | 37 |
|
26 | 38 | ### Installation steps |
27 | 39 |
|
28 | | -1. **Edit the DataFlow template** |
| 40 | +#### Connecting Azure Data Lake Storage for data archival |
| 41 | + |
| 42 | +Required - using Azure Synapse Link allows us to export significant telemetry from Dataverse, and has the additional benefit of allowing storage of telemetry longer than it is stored in your Dataverse instance (default 30 days)Steps for configuring this are as follows: |
| 43 | + |
| 44 | +> Important - always test this process on a development environment before applying to your production system. |
| 45 | +
|
| 46 | +1. [Set up an Azure Data Lake, and connect to it using Azure Synapse Link](https://docs.microsoft.com/en-us/powerapps/maker/data-platform/azure-synapse-link-data-lake). |
| 47 | + |
| 48 | +2. Configure the conversationtranscript table for export using Azure Synapse Link |
| 49 | + 1. In the Power Apps portal, select Azure Synapse Link - select the link you created in step 1 - Manage tables |
| 50 | + 2. Search for 'conversationtranscript' - Save. |
| 51 | + 3. Transcipts will now be exported to your Azure Data Lake |
| 52 | + |
| 53 | +#### Set up Dataflows |
| 54 | + |
| 55 | +1. Create a new Power BI Dataflow exposing the data stored in Data Lake (we will call this **Dataflow 1**) |
| 56 | + 1. Open your Power BI Workspace - New - Dataflow |
| 57 | + 2. Select 'Attach a Common Data Model' folder |
| 58 | + 3. Browse you Azure Data Lake container, and paste the URL of your 'model.json' file that describes your data. |
| 59 | + |
| 60 | +2. Edit the DataFlow template |
29 | 61 | 1. [Find your Dataverse environment URL](https://docs.microsoft.com/en-us/powerapps/maker/data-platform/data-platform-powerbi-connector#find-your-dataverse-environment-url), the URL will be in the format: https://yourenvironmentid.crm.dynamics.com/. You will just need the 'yourenvironmentid' part of the URL |
30 | 62 | 2. Download the file [PVA Analytics_Export_Transform.json](PVA_Analytics_Export_Transform.json?plain=1) and open it in a text editor, e.g. Visual Studio Code. |
31 | 63 | 3. Perform a find and replace on the file - swapping the placeholder `yourdataverse` with your Dataverse environment URL. |
32 | 64 |
|
33 | | -2. **Create the DataFlow from the template** |
| 65 | +3. Create the DataFlow from the template (**Dataflow 2**) |
34 | 66 | 1. Log in to Power BI at <http://powerbi.com> |
35 | 67 | 2. Select the Workspace you wish to deploy the DataFlow to or create a new workspace. Please note that you cannot use 'My Workspace' for this purpose. |
36 | 68 | 3. Select New > DataFlow |
37 | 69 | 4. Select Import Model |
38 | 70 | 5. Select the edited file 'PVA Analytics_Export_Transform.json'. Your DataFlow job should now be ready - test refreshing the data. |
39 | 71 | 6. You should be prompted for credentials, if not go to Settings -> Data source credentials and select organizational account. You can now login with an Azure Active Directory account that has access to the Dataverse environment. |
40 | 72 | 7. Whilst in Settings for your DataFlow, be sure to select 'Enhanced compute engine settings' and select 'On'. |
41 | | - 8. If you want to refresh the content periodically, go to Settings -> Scheduled refresh and select the preferred period. |
| 73 | + 8. You will likely want to refresh the content periodically, go to Settings -> Scheduled refresh and select the preferred period. |
| 74 | + |
| 75 | +4. Add the Dataflow 1 version of conversationtranscript to Dataflow 2 (chaining them together) |
| 76 | + 1. Edit Dataflow 2 - select 'Edit tables'. |
| 77 | + 2. You should now be in the Power Query editor. Select Get data - more... - Power Platform - Power BI Dataflows. |
| 78 | + 3. Sign in, and then select the conversationtranscript table from Dataflow 1. |
| 79 | + 4. You should now return to the Power Query editor. We need to change each reference to conversationtranscript to point to the new table we just imported. Select the original conversationtranscript table - and then look at the Applied Steps window on the right of the screen. Delete any steps after 'Source'. Select the source step, and replace any value with the name of the conversationtranscript table from Dataflow 1. This effectively makes the source of conversationtranscript in Dataflow 2 to be conversationtranscript from Dataflow 1. |
42 | 80 |
|
43 | | -3. **Create your Power BI report** |
| 81 | +5. Note that managing the data in your DataLake will require additional attention, outside the scope of these steps. |
| 82 | + |
| 83 | +#### Set up the report |
| 84 | + |
| 85 | +1. Create your Power BI report |
44 | 86 | 1. Download the file [PVA_Dashboard_DataFlow.pbit](PVA_Dashboard_DataFlow.pbit?plain=1) |
45 | 87 | 2. Enter the parameters you are prompted for. These are: |
46 | 88 | 1. The name of the Power BI workspace |
47 | | - 2. The name of the DataFlow you created |
| 89 | + 2. The name of DataFlow 2 |
48 | 90 | 3. The report should pull in the data and render it |
49 | 91 | 4. You can now [publish the report from Power BI Desktop](https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-upload-desktop-files) so that other users can access it. |
50 | 92 |
|
51 | | -## Connecting Azure Data Lake Storage for data archival |
52 | | - |
53 | | -Please follow the instructions in the main [readme] (../readme.md) for details of setting this up. Instead of consuming the DataFlow containing the ConversationTranscript records (stored in Azure Data Lake) in the Power BI report, it should be consumed in the PVA Analytics_Export_Transform DataFlow (change the source of ConversationTranscript from Dataverse to point the Azure Data Lake DataFlow). |
54 | | - |
55 | 93 | ## Troubleshooting |
56 | 94 |
|
57 | 95 | There are a few places where the pipeline may break - troublshooting can normally isolate the problem using these steps: |
|
0 commit comments