Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Connect to Github Repo with Power BI

Hi

 

I have been using the Microsoft template for connecting to Github 

Tutorial: Connect to a GitHub repo with Power BI - Power BI | Microsoft Docs

but now would like to expand my report to look at comments on each of the pull request. 

 

I am trying to modify one of the existing queries in the custom connector using the following format to get the comments however this is not working.

/repos/juribalimited/dashworks/pulls/{PR number}/comments

 

Do I now need to write my own custom connector in Visual Studio to be able to do this?

  • Hi Anonymous ,

     

    You can try web connector. In From Web, enter the URL of the Web page from which you'd like to extract data. This connector use HTTP Protocol to get data from Github service.

    If you need headers for GET or POST, please refer M function Web.Contents.

    After you get data from html, use power query editor to do some cleaning of the data to get the data you want.

    Using Get Data from Web by example 

     

    Or you can try python spider by python script in power bi.

    Run your Python script and import data 

     

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

3 Replies

  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Community Support

    Hi Anonymous ,

     

    You can try web connector. In From Web, enter the URL of the Web page from which you'd like to extract data. This connector use HTTP Protocol to get data from Github service.

    If you need headers for GET or POST, please refer M function Web.Contents.

    After you get data from html, use power query editor to do some cleaning of the data to get the data you want.

    Using Get Data from Web by example 

     

    Or you can try python spider by python script in power bi.

    Run your Python script and import data 

     

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi

       

      Thank you for your suggestion. I have generated a personal access token and am trying to connect using the web connector but I am getting the following error message where the blank contains the owner and repository

       

      I have tried all the settings on the API token

      My source code is 

      let
      Key= "PowerBINew",
      Source = Json.Document(Web.Contents("https://api.github.com/repos/" & Owner & "/" & Repo & "/stats/contributors",[ApiKeyName=Key]))

      in
      Source

       

      Any assistance would be appreciated