Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Copycat
Frequent Visitor

Download commits, commiter data from GitHub to PowerBI

Good day,

 

Technical:

My team and myself are pushing our .pbip files to company GitHub, each saved in its own folder.

 

Scope:

I want to create a table, which then will be replicated for each report so user can see a changelog. 

The changelog should show: commit message | commiter ID | commit date | report name.

 

Current solution:

I was able to achieve all of it with below code:


Auth: Basic

let
    Owner = "git-owner",
    Repo = "git-repo",
    Branch = "pbi-reports",
    
    BaseUrl = "https://github.contosco.com/api/v3/repos/" & Owner & "/" & Repo & "/commits",
    
    Source = Json.Document(Web.Contents(BaseUrl, [Query = [sha = Branch, per_page = "100"]])),
    ToTable = Table.FromRecords(Source),
    
    AddFilesList = Table.AddColumn(ToTable, "Files", each 
        let
            CommitUrl = "https://github.contosco.com/api/v3/repos/" & Owner & "/" & Repo & "/commits/" & [sha],
            CommitDetails = Json.Document(Web.Contents(CommitUrl)),
            Files = CommitDetails[files]
        in
            Files
    )

 

Locally, everything is working perfectly.

 

Issue:

When I upload it to powerbi.com, I receive below error message during refresh:

Data source error{"error":{"code":"DMTS_OAuthFailedToGetResourceIdError","pbi.error":{"code":"DMTS_OAuthFailedToGetResourceIdError","details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"Failed to get OAuth resource, please make sure the OAuth is supported"}}],"exceptionCulprit":1}}}

 

So I have tried to pass PAT within the M code e.g,:

Source = Json.Document(Web.Contents(BaseUrl,
        [
            Query = [sha = Branch, per_page = "100"],
            Headers = [Authorization="Bearer PAT_TOKEN_IS_HERE"]
        ]))

But this failed as well.

 

Question:
Is there a solution to download all of the data I need without modifying the gateway or putting company data at risk?

I don't remember now what I did but I also received error about dynamic data sources - which was a new error, some progress, but I was not able to resolve it either.

 

Edit:

I also tried to use beta GitHub connector (PowerBI > Get Data) but I was not able to login since it was asking for credentials and combination of email/login and PAT (instead of password) did not work.

 

 

1 ACCEPTED SOLUTION

Hii @Copycat 

 

Since you're using GitHub Enterprise with SSO, the Power BI GitHub connector will not work  it only supports public github.com using GitHub’s own OAuth app. Enterprise SSO logins, enterprise domains (github.company.com), and PAT-based auth are not supported in the connector, so your use case cannot refresh in Power BI Service.

The working alternatives is :

 Power Automate >> connect to GitHub Enterprise using SSO >> save commits/JSON to SharePoint/Blob >. Power BI refreshes from there.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

7 REPLIES 7
v-priyankata
Community Support
Community Support

Hi @Copycat 

Thank you for reaching out to the Microsoft Fabric Forum Community.

@rohit1991 Thanks for the inputs.

I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.

 

Hi @Copycat 

Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.

rohit1991
Super User
Super User

Hii @Copycat 

 

 

Your M code works locally but cannot refresh in Power BI Service because GitHub REST API requires OAuth, and Power BI Service only supports that through the GitHub connector, not custom M.

To fix:
Use the GitHub connector
or
Use Power Automate / Azure automation to store the data first

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

How can I use GitHub connector?
When I select it via Get Data -> GitHub, I provide 'owner' and 'repo name' it opens browser and asks me to log in.

As I mention before I have tried below combinations (login | password):
company_email | PAT
company_id | PAT
PAT | no password required

 

My PAT setup is: admin:org, repo, user, workflow

Hii @Copycat 

 

You can connect using below steps :

  1. Power BI Desktop >> Get Data >> GitHub
  2. Enter:
    • Owner = org or user name
    • Repository = repo name
  3. When the browser opens >> log in with your normal GitHub account
  4. GitHub will ask permission:
    • “Power BI wants to access your GitHub data”
  5. Click Authorize
  6. Power BI retrieves an OAuth token automatically

There is no need of PAT or Password.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

I may forgot to include this information.
I'm using GitHub Enterprise not personal GH (github.company_name.com). That means I do not have password for my github account since I need to log in via SSO.

 

After reading a bit, I found that this PowerBI connector won't work for my usecase - because of above.

 

Still looking for a different way to do it. Does anyone got any ideas how to achieve it?

Hii @Copycat 

 

Since you're using GitHub Enterprise with SSO, the Power BI GitHub connector will not work  it only supports public github.com using GitHub’s own OAuth app. Enterprise SSO logins, enterprise domains (github.company.com), and PAT-based auth are not supported in the connector, so your use case cannot refresh in Power BI Service.

The working alternatives is :

 Power Automate >> connect to GitHub Enterprise using SSO >> save commits/JSON to SharePoint/Blob >. Power BI refreshes from there.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.