Skip to content

Commit d7d0d69

Browse files
committed
README
1 parent 28f33cb commit d7d0d69

8 files changed

+46
-16
lines changed

README.md

+46-16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Azure Logic App: Long-Term Github Stats
22

3-
Github only tracks 14 days worth of traffic data for each repository. There are a few other projects out there that use C#, Python and other langauges to pull the data locally but I wanted to run this serverless in Azure which is why I created this solution.
3+
Github only tracks 14 days worth of traffic data for each repository. There are a few other projects out there that use different langauges to pull the data locally, but I wanted to run this serverless in Azure which is why I created this solution to run in [Azure Logic Apps](https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-overview).
44

55
This ARM template will deploy the following:
66

77
- Resource Group
8-
- KeyVault (to store your Github Personal Access Tolken as a Secret)
8+
- Key Vault (to store your Github Personal Access Token as a Secret)
99
- Storage Account (to store your Github stats as Table Storage)
1010
- Logic App
1111

@@ -15,24 +15,54 @@ After the data is loaded into Table Storage you can do whatever you'd like with
1515

1616
This solution should cost less than $0.05/month (I'll update this statistic once I've run it longer, as of Dec 31, 2020 I've had it running for 4 days and it's cost me $0.01).
1717

18+
### Contributing:
19+
20+
PRs and issues welcome!
21+
1822

1923
## How to deploy:
2024

21-
- Step 1:
22-
- You will need a Github Personal Access Tolken, you can view the Github docs on that here: https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token
23-
- Step 2:
24-
- Click "Deploy to Azure" below
25-
- Step 3:
26-
- Open CloudShell, and run ```get-azaduser -UserPrincipalName [email protected] | select-object Id``` and copy that Object ID
27-
- Step 4:
28-
- Enter the parameter values on the deployment screen, and click deploy.
29-
- Step 5:
25+
*I will be recording and posting a deployment video soon, in the mean time you can follow the steps below.*
26+
27+
- **Step 1**:
28+
- You will need a Github Personal Access Token, you can view the Github docs on that here: https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token
29+
- **Step 2**:
30+
- Click [Deploy to Azure](#deploy), in the Deploy section of this page.
31+
- **Step 3**:
32+
- In the Azure Portal, open a PowerShell CloudShell, and run ```get-azaduser -UserPrincipalName [email protected] | select-object Id``` using the username with which you are logging into Azure (top right of the portal). Copy that Object ID,this is required for creating access policies in Key Vault and is an input parameter for deployment.
33+
34+
<img src="images/cloudshell.png" width="75%">
35+
36+
<img src="images/objectID.png" width="75%">
37+
38+
39+
- **Step 4**:
40+
- Enter the parameter values on the deployment screen in the Azure Portal after you clicked "Deploy to Azure", and click deploy.
41+
- **Step 5**:
3042
- Once complete, you will need to open the API connection for keyvault, go to "Edit API" and click the blue bar that says "Authorize". You'll be presented with a pop-up sign-in box for a one-time authentication to link the connector to KeyVault. Click save after you're done.
31-
- Step 6:
43+
44+
<img src="images/authorizeKV.png" width="75%">
45+
46+
<img src="images/connectedKV.png" width="75%">
47+
48+
- **Step 6**:
3249
- Open the Logic App, and click "Run Trigger" (the first run will have failed becuase the connector wasn't authorized so you'll see that in the run history).
33-
- Step 7:
50+
51+
<img src="images/logicappRun.png" width="75%">
52+
53+
- **Step 7**:
3454
- You can verify the data by going to the storage account and viewing the table storage using Storage Explorer.
35-
- Step 8:
36-
- Open the PowerBI template, enter your storage account name and account key (account keys tab on the storage account in the portal) and your data should show up on the dashboard.
55+
- **Step 8**:
56+
- Open the PowerBI template using [PowerBI Desktop](https://powerbi.microsoft.com/en-us/downloads/), enter your storage account name and account key (account keys tab on the storage account in the portal) and your data should show up on the dashboard.
57+
58+
<img src="images/accessKey.png" width="75%">
59+
60+
<img src="images/powerBI.png" width="75%">
61+
62+
This Logic App will run every day now to collect the stats for that repo and update the storage account with anything new. You now have the data in raw form and loaded into PowerBI and can do anything you'd like with it.
63+
## Deploy:
64+
65+
[//]: # (The short URLs below are to show impact of this solution by tracking number of deployments. You can use the direct link if you wish - https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FMattHansen0%2Flogicapp-githubstats%2Fmain%2Fazuredeploy.json)
66+
3767

38-
[![Deploy To Azure](http://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FMattHansen0%2Flogicapp-githubstats%2Fmain%2Fazuredeploy.json) [![Visualize](http://armviz.io/visualizebutton.png)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FMattHansen0%2Flogicapp-githubstats%2Fmain%2Fazuredeploy.json)
68+
[![Deploy To Azure](http://azuredeploy.net/deploybutton.png)](https://urls.hansencloud.com/deploy-githubstats-logicapp) [![Visualize](http://armviz.io/visualizebutton.png)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FMattHansen0%2Flogicapp-githubstats%2Fmain%2Fazuredeploy.json)

images/accessKey.PNG

43.6 KB
Loading

images/authorizeKV.PNG

40.2 KB
Loading

images/cloudshell.PNG

22.4 KB
Loading

images/connectedKV.PNG

40 KB
Loading

images/logicappRun.PNG

58.8 KB
Loading

images/objectID.PNG

27.4 KB
Loading

images/powerBI.PNG

151 KB
Loading

0 commit comments

Comments
 (0)