How to Manage Branches in Microsoft Fabric Workspaces

Branches in Microsoft Fabric : Microsoft Fabric is a cloud-based platform that enables you to create, share, and consume business intelligence (BI) content. It offers a variety of tools and features to help you analyze data, create reports and dashboards, and collaborate with others. One of the most powerful features of Microsoft Fabric is Git integration, a tool that allows you to integrate your development processes, tools, and best practices straight into the Fabric platform.

Git integration enables you to connect your Fabric workspaces to Git repositories, where you can store, version, and manage your BI content as code. You can also use Git branches to work on different versions of your content in isolation, without affecting the main branch or other developers. In this blog post, I will show you how to create and use branches in Microsoft Fabric workspaces.

What are branches?

Branches are parallel lines of development that diverge from a common base. They allow you to work on different features, experiments, or bug fixes without interfering with the main branch or other branches. You can create as many branches as you need, and merge them back into the main branch when they are ready.

Branches are useful for several scenarios, such as:

  • Developing new features or enhancements
  • Testing new ideas or hypotheses
  • Fixing bugs or issues
  • Reviewing or approving changes
  • Deploying content to different environments

How to create a branch?

To create a branch in Microsoft Fabric, you need to have an Microsoft Fabric subscription and be an admin of a Fabric workspace. You also need to connect your workspace to a Git repository, such as GitHub or Azure DevOps. You can create a branch from anywhere in Fabric by following these steps:

  • From the Workspaces flyout, select Deployment pipelines.
  • Select the pipeline that you want to work with.
  • Select Assign workspace for the stage that you want to assign a workspace to.
  • In the Assign workspace dialog box, select an existing workspace or create a new one.
  • Select Assign.
  • In the Workspace settings, select Git integration.
  • Under Branch drop-down, choose Create a new branch, and branch it from the main branch or any other branch.
  • In Git folder, enter the name of the folder you want to sync to in your repo.
  • Select Connect.

You can also create a branch from inside an existing workspace by selecting Create branch from the workspace menu.

How to connect Microsoft Fabric to Azure OpenAI Service and create generative AI applications

How to switch between branches?

To switch between branches in Microsoft Fabric, you need to make sure that the current branch is synced and all changes are committed. Then, you can follow these steps:

  • From the Workspace settings, select Git integration
  • From the dropdown menu, specify the branch you want to connect to. This branch must contain the same directory as the current branch.
  • Select Connect.

You can also switch between branches from inside an existing workspace by selecting Switch branch from the workspace menu.

How to merge branches?

To merge branches in Microsoft Fabric, you need to use an external tool such as GitHub or Azure DevOps. You can create a pull request (PR) from your source branch to your target branch, and review and approve the changes before merging them. You can also use the REST APIs or DevOps tools to automate your merge process. Learn more about how to do that here.

Once the branches are merged, the shared team’s workspace is prompted to accept the new commit. The changes are updated into the shared workspace and everyone can see the changes to those datasets and reports.

How to Get Started with Deployment Pipelines in Microsoft Fabric

FAQs

Here are some frequently asked questions about branches in Microsoft Fabric:

Q: What are the benefits of using branches in Microsoft Fabric?

A: Branches in Microsoft Fabric help you:

  • Work on your BI content in isolation and avoid conflicts with other developers
  • Experiment with different versions of your content without affecting the main branch
  • Track and manage the history and changes of your content
  • Integrate your development workflow with Git tools and best practices

Q: What types of items can I store and manage using branches in Microsoft Fabric?

A: You can store and manage any type of item that is supported by Fabric workspaces, such as datasets, reports, dashboards, dataflows, apps, etc. See the full list of supported item types here.

Q: How many branches can I have in my Microsoft Fabric workspace?

A: You can have as many branches as you need in your Microsoft Fabric workspace. However, you can only connect one branch at a time to your workspace. To switch between branches, you need to disconnect and reconnect your workspace.

Q: How do I share my branches with others?

A: You can share your branches with others by using Git tools such as GitHub or Azure DevOps. You can also invite others to collaborate on your workspace by selecting Share from the workspace menu. When you share a workspace with others, they become admins of the workspace, and can view, edit, and delete the content.

Q: How do I delete my branches?

A: You can delete your branches by using Git tools such as GitHub or Azure DevOps. Note that deleting a branch does not delete the workspace or the content within it. You can still access them from the Workspaces flyout.

Conclusion

Branches are a great way to manage the versions of your BI content in Microsoft Fabric. They help you work on your content in isolation, experiment with different ideas, and integrate your development workflow with Git tools and best practices.