DevOps et observabilité

Connect Microsoft Fabric to Git

Connect a Microsoft Fabric workspace to a GitHub or Azure DevOps repository step by step, and understand branches, folders, commits, updates, conflicts and what belongs in source control.

Par JaviPublié 12 min de lectureDébutant

The best time to connect a Fabric workspace to Git is before it contains anything. There is nothing to reconcile, no question about which side is newer, and every item you create from then on has a history.

In this tutorial you connect the jb-fabric-dev workspace from Create Your First Microsoft Fabric Workspace to a repository called fabric-data-platform. You will see what Fabric stores in Git, how changes move between the workspace and the repository, and why Git on its own is not a deployment process.

This is the beginner setup. For the full team workflow, with branch-per-developer workspaces, pull requests and conflict resolution, continue later with Git Integration in Microsoft Fabric: A Practical Development Workflow.

Why source control matters

A Fabric workspace is a live environment. Without Git, the current state of a notebook is the only state: no history, no review, and no way to rebuild the workspace if someone deletes an item or overwrites a pipeline.

Source control gives you:

  • History: who changed what, when, and why.
  • Review: changes can go through a pull request before they reach a shared branch.
  • Reproducibility: a workspace can be rebuilt from the repository.
  • Recovery: a bad change is reverted with a commit, not reconstructed from memory.
  • A deployment input: CI/CD pipelines deploy from the repository, so what runs in production is something that was committed and reviewed.

For a team, the last point matters most. Once the repository is the source of truth, a “production change” means “a reviewed commit”, not “someone edited the production workspace”.

How Fabric Git integration works

Git integration works at the workspace level. A workspace is connected to:

  • one repository,
  • one branch in that repository,
  • one folder in that branch.

Fabric creates a repository representation for each supported item: a folder of text files, typically a .platform metadata file plus definition files such as the source code of a notebook or the JSON definition of a pipeline. The workspace and the branch are then kept in step with two operations: commit and update.

Fabric currently supports Azure DevOps and GitHub repositories in their cloud versions. Most data engineering items are supported, including Lakehouses, notebooks, pipelines, Warehouses, semantic models and reports, though some item types are still in preview. Check the current supported-items list before you rely on a specific item.

The vocabulary

Concept In Fabric Git integration
Repository The Git repo that stores item definitions, here fabric-data-platform
Branch The one branch the workspace is connected to, for example feature/fabric-learning
Folder The directory in the branch where this workspace’s items live, for example fabric
Synchronization Keeping workspace and branch at the same commit, item by item
Commit Workspace → Git: save selected workspace changes as a commit on the connected branch
Update Git → workspace: apply new commits from the branch to the workspace
Conflict The same item changed in both the workspace and the branch since the last sync

Workspace state vs Git repository state

This is the concept that makes everything else clear: there are always two copies.

  • The workspace state is what is live in Fabric: the items you can open and run.
  • The repository state is what is committed on the connected branch.

Saving a notebook in Fabric changes the workspace state only. Nothing reaches Git until you commit. Likewise, someone pushing to the branch changes only the repository state; your workspace does not change until you update it.

The workspace’s source control view shows the difference item by item: whether an item is synced (both copies match), has uncommitted workspace changes, needs an update from the branch, or is in conflict because both changed. The exact status labels can vary between Fabric releases; the four situations do not.

  1. DeveloperEdits items
  2. Fabric workspacejb-fabric-dev
  3. Git repositoryCommit ⇄ update
  4. CI/CDValidate and deploy
  5. Higher environmentsTest, production
The development loop. Git integration covers the two-way link between the workspace and the repository; CI/CD moves reviewed commits to other environments.

The arrow between the workspace and the repository goes both ways: commit and update. Everything to the right of the repository is a separate process, which you will build later.

Before you start

In Fabric:

  • The workspace is on a Fabric capacity or trial. Git integration requires one.
  • You are an Admin of jb-fabric-dev. Only workspace admins can connect, disconnect or change the connection.
  • Your tenant allows Git integration. Administrators control it with tenant settings that let users synchronize workspace items with Git repositories, and GitHub has its own separate setting. Ask them if the Git integration option is missing or disabled in your workspace settings.

In your Git provider:

  • A repository called fabric-data-platform with at least one commit on main. The simplest way is to create it with a README. An empty repository has no branch to connect to.
  • For Azure DevOps: an account for the same Microsoft Entra identity you use in Fabric, with access to the repository.
  • For GitHub: a fine-grained personal access token limited to this repository, with Contents set to read and write. Give it an expiry date.

Connect the workspace

1. Open the Git integration settings

Open jb-fabric-dev, open the workspace settings, and choose the Git integration option. Pick your provider: Azure DevOps or GitHub.

2. Authenticate

The first time, you add a Git account connection; later you can select the existing one.

  • Azure DevOps: sign in with the Microsoft Entra account you use in Fabric (OAuth), give the connection a display name, and point it at the repository. Azure DevOps repository URLs have this form:

    https://dev.azure.com/{organization}/{project}/_git/fabric-data-platform
  • GitHub: give the connection a display name, provide the fine-grained token, and optionally the repository URL. If you enter the URL, this connection can only be used for that repository, which is a sensible restriction.

Confirm the connection. It belongs to you: everyone who works in the workspace later authenticates with their own Git account. Do not share one token across a team.

3. Choose the branch

For Azure DevOps, select the organization, project and repository. For GitHub, select or confirm the repository.

For the branch, use the branch selector’s option to create a new branch, and create feature/fabric-learning from main.

Why not connect straight to main? In a team, main should only change through reviewed pull requests, and branch policies should reject direct commits. Connecting a development workspace to a feature branch builds the right habit even when you work alone: you commit freely to the feature branch and merge to main when the work is ready.

4. Choose the folder

For the folder, enter fabric. Fabric creates /fabric in the branch if it does not exist and stores every item from this workspace under it.

A dedicated folder keeps the repository root free for other things: documentation, deployment configuration, CI pipeline definitions and SQL scripts. If you leave the folder empty, items go to the repository root.

5. Connect and sync

Confirm the connection (the button currently reads Connect and sync). Fabric then runs the initial sync.

On the first sync, Fabric compares both sides:

  • If either the workspace or the folder in the branch is empty, content is copied from the non-empty side.
  • If both have content, Fabric asks you which direction to sync. Committing overwrites the branch; updating overwrites the workspace.

Your workspace and the fabric folder are both empty, so nothing is copied. That is the clean start this tutorial was designed for.

6. Check the result

The workspace now shows its source control status: the connected branch, the sync status of each item and the time of the last sync. The Git integration settings show the repository, branch and folder.

Your first commit

There is nothing to commit yet. In the next tutorial you create a Lakehouse called lh_learning. When you do, the workspace’s source control view shows one pending change. Then:

  1. Open the source control panel and look at the list of changes.
  2. Select lh_learning. It is marked as new.
  3. Enter a message such as Add lh_learning lakehouse.
  4. Commit.

The item becomes synced, and the branch now has a folder for it, roughly like this:

fabric-data-platform/
├── README.md
└── fabric/
    └── lh_learning.Lakehouse/
        ├── .platform
        └── … definition files

After the notebook tutorial, a folder for nb_first_sales appears next to it, containing the notebook’s source code. Fabric decides the exact files for each item type, and they change as Fabric evolves; what matters is that each supported item is a folder of readable text you can review and diff.

Notice what is not there: no tables, no Parquet files, no data. Git integration stores item definitions. The rows you will write into lh_learning live in OneLake and are never committed.

Commit and update day to day

Commit sends workspace changes to Git. You choose which items to include and write a message. If the branch has new commits you have not pulled, commit is disabled until you update first, so you never commit on top of a branch state you have not seen.

Update brings branch changes into the workspace. It always applies the whole branch; you cannot pick individual items.

A simple routine:

  1. Update at the start of a session so the workspace matches the branch.
  2. Work, test, and commit small, related changes with clear messages.
  3. Update again before committing if anyone else uses the branch.
  4. When the work is done, open a pull request from feature/fabric-learning into main in GitHub or Azure DevOps.

Conflicts, practically

A conflict happens when the same item changed in the workspace and in the branch since the last sync. Fabric marks the item as conflicted and disables commit until it is resolved.

You have three practical options:

  • Accept the branch version of the item if your workspace change is disposable.
  • Keep your workspace version and commit it if you are sure the branch change should be overwritten.
  • Resolve in Git: commit your workspace to a new branch, merge the two branches in your Git provider, and then update the workspace.

When you work alone in one workspace on one branch, conflicts are rare. They become common when several people edit the same workspace or branch, which is why teams give each developer their own branch and workspace. Git Integration in Microsoft Fabric covers those resolution paths in detail, and the Git merge conflicts cheat sheet covers the Git side.

What should go into Git?

Put in Git everything that defines your solution and that you would need to rebuild it:

  • Item definitions that Fabric serializes: notebooks, pipelines, Lakehouse and Warehouse definitions, semantic models, reports and environments.
  • SQL scripts and database projects for Warehouse objects.
  • Deployment configuration, such as the parameter files that map development values to test and production values.
  • CI pipeline definitions that validate and deploy the workspace.
  • A README explaining the repository layout, how to set up a development workspace, and where test data comes from.

Do not try to put data in Git. Lakehouse tables, files in the Files area and query results belong in OneLake. Large sample files and data exports bloat the repository and cannot be diffed meaningfully.

What is (and is not) a secret in Git?

Some values look sensitive but are not secrets, and treating them as secrets only makes deployment harder:

  • workspace, Lakehouse and item names and IDs,
  • OneLake paths and SQL analytics endpoint host names,
  • connection names, environment names and capacity names,
  • table names, schemas and column lists.

These are configuration. They may differ per environment, which is why deployment tools replace them, but they do not grant access on their own. Access is still controlled by Microsoft Entra ID and workspace roles.

Real secrets must never be committed, in any file, in any branch:

  • passwords,
  • access tokens and personal access tokens,
  • connection strings with embedded credentials and other connection secrets,
  • service principal client secrets,
  • private keys and certificates.

The risk in Fabric is usually a notebook. A connection string pasted into a cell for a quick test is part of the notebook’s source, and the next commit sends it to Git. Read your Changes list before every commit.

Git is not deployment by itself

Connecting a workspace to Git gives you history and review. It does not:

  • copy items from development to test or production,
  • replace development values, such as Lakehouse IDs or connection names, with production ones,
  • decide which commit is running in which environment.

That is the job of a deployment process. In Fabric that means deployment pipelines or a code-first tool such as fabric-cicd, triggered from a reviewed commit on main. Test and production workspaces are usually not connected to Git at all; they are updated only by the release pipeline.

The CI/CD section of the Fabric learning path builds that process step by step.

Common mistakes

  • Connecting a workspace with content to a branch with content and choosing the wrong sync direction.
  • Connecting a shared workspace to main and committing directly, with no branch policies to stop it.
  • Committing secrets inside notebook cells or configuration files.
  • Expecting Git to back up data. It restores definitions, not tables or files.
  • One huge commit with unrelated changes, which makes review and rollback painful.
  • Sharing one personal access token across a team instead of per-user connections.
  • Connecting production workspaces to Git and “updating” them, which creates a second, unreviewed way to change production.

What you learned

  • Fabric Git integration connects one workspace to one repository, branch and folder, and serializes items as folders of text files.
  • There are always two states: the workspace and the repository. Commit moves changes to Git; update brings changes into the workspace.
  • You connected jb-fabric-dev to fabric-data-platform, on the branch feature/fabric-learning, in the folder fabric, while the workspace was still empty.
  • Git stores definitions, not data. Names and IDs are configuration; passwords, tokens, connection secrets, service principal secrets and private keys never belong in a repository.
  • Git integration is source control. Deployment to other environments is a separate CI/CD process.

Next: Create Your First Fabric Lakehouse

Your workspace is versioned and ready. Next, create the Lakehouse that will hold your data, explore its Files and Tables areas, and make your first commit: Create Your First Fabric Lakehouse.

Previous step: Create Your First Microsoft Fabric Workspace. Full sequence: Microsoft Fabric learning path. For everyday Git commands, keep the Git branches and merging cheat sheet nearby.

Étiquettes

  • Microsoft Fabric
  • Git
  • DevOps
  • CI/CD