Edit

Get started with Git integration

This article walks you through the following basic tasks in Microsoft Fabric’s Git integration tool:

We recommend reading the overview of Git integration before you begin.

Prerequisites

To integrate Git with your Microsoft Fabric workspace, you need to set up the following prerequisites for both Fabric and Git.

Fabric prerequisites

To access the Git integration feature, you need a Fabric capacity. A Fabric capacity is required to use all supported Fabric items. If you don't have one yet, sign up for a free trial. Customers that already have a Power BI Premium capacity, can use that capacity, but keep in mind that certain Power BI SKUs only support Power BI items.

In addition, the following tenant switches must be enabled from the Admin portal:

These switches can be enabled by the tenant admin, capacity admin, or workspace admin, depending on your organization's settings.

Git prerequisites

Git integration is currently supported for Azure DevOps and GitHub. To use Git integration with your Fabric workspace, you need the following in either Azure DevOps or GitHub:

  • An Active Azure DevOps account registered to same Fabric user (supported even if Azure DevOps organization reside in a different tenant than Fabric tenant). Create a free account.
  • Access to an existing repository.

Connect a workspace to a Git repo

Connect to a Git repo

Only a workspace admin can connect a workspace to a repository, but once connected, anyone with permission can work in the workspace. If you're not an admin, ask your admin for help with connecting. To connect a workspace to an Azure or GitHub Repo, follow these steps:

  1. Sign into Fabric and navigate to the workspace you want to connect with.

  2. Go to Workspace settings

    Screenshot of workspace with workspace settings icon displayed on top.

  3. Select Git integration.

  4. Select your Git provider. Currently, Azure DevOps and GitHub are supported.

If you select Azure DevOps, select Connect to automatically sign into the Azure Repos account registered to the Microsoft Entra user signed into Fabric.

If you have already signed in to Azure from Fabric using a different account, select your account from the list and select Connect.

If it's your first time signing in from Fabric, or you want to add a new account, select Add account.

If it's the first time connecting, you need to Authorize your user. Provide the following information:

  • Display name - must be unique for each user
  • Azure DevOps URL - URL of the Azure DevOps repository. URL must be in the format https://dev.azure.com/{organization}/{project}/_git/{repository} or https://{organization}.visualstudio.com/{project}/_git/{repo}.
  • Authentication - You can authenticate either with OAuth2 or a Service Principal. For more information see Azure DevOps - Git Integration with service principal

Screenshot of GitHub integration UI to add an account.

After you sign in, select Connect to allow Fabric to access your account

Connect to a workspace

If the workspace is already connected to Azure DevOps/GitHub, follow the instructions for Connecting to a shared workspace.

  1. From the dropdown menu, specify the following details about the branch you want to connect to:

    • Organization
    • Project
    • Git repository.
    • Branch (Select an existing branch using the drop-down menu, or select + New Branch to create a new branch. You can only connect to one branch at a time.)
    • Folder (Type in the name of an existing folder or enter a name to create a new folder. If you leave the folder name blank, content is created in the root folder. You can only connect to one folder at a time.)

Screenshot to Azure connection.

Select Connect and sync.

During the initial sync, if either the workspace or Git branch is empty, content is copied from the nonempty location to the empty one. If both the workspace and Git branch have content, you’re asked which direction the sync should go. For more information on this initial sync, see Connect and sync.

After you connect, the Workspace displays information about source control that allows the user to view the connected branch, the status of each item in the branch and the time of the last sync.

Screenshot of source control icon and other Git information.

To keep your workspace synced with the Git branch, commit any changes you make in the workspace to the Git branch, and update your workspace whenever anyone creates new commits to the Git branch.

Commit changes to git

Once you successfully connect to a Git folder, edit your workspace as usual. Any changes you save are saved in the workspace only. When you’re ready, you can commit your changes to the Git branch, or you can undo the changes and revert to the previous status.

Read more about commits.

To commit your changes to the Git branch, follow these steps:

  1. Go to the workspace.

  2. Select the Source control icon. This icon shows the number of uncommitted changes. Screenshot of source control icon with the number 2 indicating that there are two changes to commit.

  3. Select the Changes from the Source control panel. A list appears with all the items you changed, and an icon indicating if the item is new , modified , conflict , same change , or deleted .

  4. Select the items you want to commit. To select all items, check the top box.

  5. Add a comment in the box. If you don't add a comment, a default message is added automatically.

  6. Select Commit.

    Screenshot of source control window with two changes selected to commit.

After the changes are committed, the items that were committed are removed from the list, and the workspace points to the new commit that it synced to.

Screenshot of source control window stating that there are no changes to commit.

After the commit is completed successfully, the status of the selected items changes from Uncommitted to Synced.

Update workspace from Git

Whenever anyone commits a new change to the connected Git branch, a notification appears in the relevant workspace. Use the Source control panel to pull the latest changes, merges, or reverts into the workspace and update live items. Changes to folders are also updated. Read more about updating.

To update a workspace, follow these steps:

  1. Go to the workspace.
  2. Select the Source control icon.
  3. Select Updates from the Source control panel. A list appears with all the items that were changed in the branch since the last update.
  4. Select Update all.

Screenshot of source control panel with the update tab open and the updating all button selected.

  1. On the confirmation dialog, select Update.

Screenshot of confirmation dialog.

After it updates successfully, the list of items is removed, and the workspace points to the new workspace that it's synced to.

Screenshot of source control window stating that you successfully updated the workspace.

After the update is completed successfully, the status of the items changes to Synced.

Disconnect a workspace from Git

Only a workspace admin can disconnect a workspace from a Git Repo. If you’re not an admin, ask your admin for help with disconnecting. If you’re an admin and want to disconnect your repo, follow these steps:

  1. Go to Workspace settings
  2. Select Git integration
  3. Select Disconnect workspace
  4. Select Disconnect again to confirm.

Permissions

The actions you can take on a workspace depend on the permissions you have in both the workspace and the Git repo. For a more detailed discussion of permissions, see Permissions.