Provide insight into GitHub users, organizations and repositories using the GitHub GraphQL API v4 and PowerBI.
- Each capability (e.g. the creation of a collaboration graph) is implemented as an independent
nano service
. The output of eachnano service
is written into a document collection of the shared Azure Cosmos DB. Each service implements its own Power BI template to visualize its data. - The final Power BI report includes the Power BI templates provided by the different
nano services
. - If a
nano service
requires sequential processing (e.g. extract the key contributors for each repository), the task should be split into multiple functions which are triggered by a queue message. - AppSettings (e.g. which repositories should be processed/excluded) are set through the
CLI tool
.
In order to use project-lenis
the first thing you'll need to do is to deploy the Azure resources to your Azure subscription. Click the Deploy to Azure
button (below) to kick off a deployment.
You will be required to provide the following parameters:
appName
: A unique identifier for your app deploymentgithubToken
: A Personal Access Token for GitHub. You can generate one heredatabaseAccountName
: A unique identifier for your CosmosDB account nameorganizations
: A comma seperated list of organisations to query against
- Install the functions core tools on your local machine if they do not already exist
npm i -g azure-functions-core-tools
- Navigate to the azure functions directory
cd $REPO_ROOT/azure-functions
- Install Nodejs dependenices
npm install
- Create a local settings file if you do not currently have one
cp appsettings.json local.settings.json
-
Check appropriate values are set in your
local.settings.json
file -
Run the azure functions runtime host
func host start --debug vscode
-
Open the folder
project-lenis
in Visual Studio Code, switch to the Debug view and selectAttach to Azure Functions
-
Open a new terminal and navigate to the
$REPO_ROOT/azure-functions
directory -
Execute the individual functions
func run your-function-name
- Create a new folder within the
azure-functions
directory. Name it the same way as yournano service
is called (e.g.github-repositories
). Place all your function files into this folder. - Name your document collection by using the
nano-service
name followed by the description of the collection itself (e.g.githubRepositories
) - Save your Power BI template in the
power-bi
folder. Name the same way as yournano service
called (e.g.github-collaboration-graph.pbit
)
Edit the data query and set for each query the datasource to your CosmosDB endpoint. Provide the account key when requested.