Skip to content

Commit 169491b

Browse files
authored
Update README.md
Minor edits and add steps.
1 parent 3ba2be4 commit 169491b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Located in the `./samples` directory you'll find sample JSON and PBIX files use
77

88
![Image of a Power BI dashboard with GitHuub Copilot Metrics API data displayed.](https://github.com/jasonmoodie/pbi-4-ghcopilot/blob/main/assets/Sample_PBI.png)
99

10-
## Modify the data source
10+
## Modify the local JSON data source
1111
> Note: This example provided a proof of concept for loading metrics data and requires an exported JSON file. If you have access to the REST API you can configure the **Source** accordingly.
1212
13-
1. Download and open the sample `GitHub Copilot - Telemetry Sample (DM).pbix` file
13+
1. Download and open the sample `GitHub Copilot - Telemetry Sample (DM).pbix` file.
1414
2. The file contains three data sources on the right hand side.
1515

1616
| Name | Description |
@@ -20,7 +20,7 @@ Located in the `./samples` directory you'll find sample JSON and PBIX files use
2020
| Last Refresh | Used to display the data time of data refresh on the top-right corner of the dashboard. |
2121

2222
3. Open the **Power Query Editor** by right clicking the `GH Copilot - Details` and selecting **Edit query**.
23-
4. Modify the **Source** step by clicking the settings icon, selecting your JSON file and clicking **OK**.
23+
4. Modify the **Source** step by clicking the settings icon, selecting your JSON file and clicking **OK**.
2424
![Image of a data source selector in Power Query Editor.](https://github.com/jasonmoodie/pbi-4-ghcopilot/blob/main/assets/Modify_JSON_source.png)
2525
6. Repeat steps 3 and 4 for the `GH Copilot - Summary` **Source**.
2626
7. Click **Close and Apply** in the top-left of the **Power Query Editor**.
@@ -31,16 +31,17 @@ Located in the `./samples` directory you'll find sample JSON and PBIX files use
3131
> Notes: The REST API provides metrics for the previous 28 days and is refreshed daily with the previous days data. This is currently in beta, so please ensure you are using the latest version of the [REST API](https://docs.github.com/en/rest/copilot/copilot-usage).
3232
3333
In order to connect we'll need to generate a token and link to your metrics data:
34-
1. Determine if you'll be using the `Enterprise`: **/enterprises/<ENTERPRISE>/copilot/usage** or `Organization`: **/orgs/<ORG>/copilot/usage** URL.
35-
2. Follow the instructions below to generate a token with permissions to access the API:
34+
1. Download and open the sample `GitHub Copilot - Telemetry Sample (DM).pbix` file.
35+
2. Determine if you'll be using the `Enterprise` or `Organization` URL.
36+
3. Follow the instructions below to generate a token with permissions to access the API:
3637
[REST API endpoints for GitHub Copilot usage metrics - GitHub Docs](https://docs.github.com/en/rest/copilot/copilot-usage)
38+
>**IMPORTANT: Do not share this token and ensure you follow you organizations security policies.**
3739
4. Open the **Power Query Editor** by right clicking the `GH Copilot - Details` and selecting **Edit query**.
38-
5. Select **Advanced editor**.
39-
40+
5. Select **Advanced editor**.
4041
![Image of Power Query Advanced Editor.](https://github.com/jasonmoodie/pbi-4-ghcopilot/blob/main/assets/Advanced_editor.png)
41-
6. Replace lines 1 and 2 with following, ensure to replace <YOUR-TOKEN> and <ORG> with your values.
42-
43-
**Organization**
42+
6. Replace the first 2 lines with following, ensure to replace <YOUR-TOKEN> and <ORG> with the values from step 1 and 2.
43+
44+
**Organization**
4445
```powerquery
4546
let
4647
// Replace <YOUR-TOKEN> and <ORG> with your actual token and enterprise name.
@@ -52,7 +53,7 @@ In order to connect we'll need to generate a token and link to your metrics data
5253
],
5354
Source = Json.Document(Web.Contents(url, [Headers=headers])),
5455
```
55-
**Enterprise**
56+
**Enterprise**
5657
```powerquery
5758
let
5859
// Replace <YOUR-TOKEN> and <ENTERPRISE> with your actual token and enterprise name.
@@ -64,11 +65,10 @@ In order to connect we'll need to generate a token and link to your metrics data
6465
],
6566
Source = Json.Document(Web.Contents(url, [Headers=headers])),
6667
```
67-
68-
7. Your Power Query will look something like this:
68+
7. Your Power Query will look something like this:
6969
![Image of Power Query Advanced Editor.](https://github.com/jasonmoodie/pbi-4-ghcopilot/blob/main/assets/Advanced_editor_query.png)
7070
8. Click **OK** to close the editor and select `Anonymous` authentication if prompted.
71-
9. Repeat steps 3 and 8 for the `GH Copilot - Summary` **Source**.
71+
9. Repeat steps 4 and 8 for the `GH Copilot - Summary` **Source**.
7272
10. Click **Close and Apply** in the top-left of the **Power Query Editor**.
7373
11. On the **Report View** page click **Refresh** to load the new data into your dashboard.
7474

0 commit comments

Comments
 (0)