Data Bear

GitHub Integration with Microsoft Fabric for Power BI

Power BI Box plots

In this comprehensive guide, you’ll learn how to set up and manage GitHub integration in Microsoft Fabric. Whether you’re pushing changes from your desktop or pulling updates from your repo, this tutorial will help streamline your Power BI development workflow

1. Generate a GitHub Personal Access Token

Before enabling GitHub integration in Microsoft Fabric, you need to generate a Personal Access Token (PAT) in GitHub with the correct permissions:

  1. In GitHub, go to Settings > Developer settings > Personal access tokens > Fine-grained tokens
  2. Click Generate new token, select an expiration period, and give it a name
  3. Choose only the repositories you want Fabric to access
  4. Set the Contents permission:
    • Use Read and write if Fabric will push changes
    • Use Read-only if Fabric will only pull updates
  5. Generate and copy the token Generate a GitHub Personal Access Token
2. Connect GitHub to Your Fabric Workspace

To start using GitHub integration in Microsoft Fabric, follow these steps:

  1. In Fabric, go to Workspace Settings > Git Integration
  2. Select GitHub and click Connect
  3. Enter a display name, your PAT, and the GitHub repo URL
  4. Click Add  your connection will appear in the Fabric gateway-style Connections listConnect GitHub to Your Fabric Workspace
3. Sync the Correct Folder and Branch

Fabric requires you to point to a specific branch and folder in your GitHub repo.

  1. Choose the branch (e.g., adventureworks)
  2. Specify the folder (e.g., ProjectYoda) that contains the reports
  3. Click Connect and Sync

Without a folder path, Fabric will not import any files.Sync the Correct Folder and Branch

4. Refresh Models and Data

Once synced, Fabric imports the report definitions, but not the data.

  1. Open the Semantic model settings
  2. Reconfigure or confirm your data source connections
  3. Refresh the model
  4. Open the report and click RefreshRefresh Models and Data
5. Make Edits in Both Directions
From Desktop to Fabric
  1. Clone your GitHub repo locally
  2. Open the Power BI report and make a change
  3. Save and run:
    git add .
    git commit -m "New report page"
    git push
    
  4. In Fabric, click Update all to pull the change

Make Edits in Both Directions

From Fabric to GitHub
  1. Edit the report in Fabric
  2. Commit the changes in the Source Control panel
  3. In GitHub, confirm the commit
  4. In your local repo, run git pull to get the latest updateFrom Fabric to GitHub
6. Manage Changes with Pull Requests

When working on a feature branch:

  1. In GitHub, create a new Pull Request from adventureworks to main
  2. Review and merge the changes
  3. Pull the merged updates to your local or Fabric workspace
 Best Practices
  • Use least-privilege access tokens
  • Always define a specific folder in your repo
  • Use branches and pull requests for collaboration
  • Refresh semantic models after syncing
  • Commit frequently to reduce conflicts
Power BI Training Resource

For more advanced Power BI development and deployment practices, check out this excellent Power BI Training.