Share

Integrating Power BI with AzureDevOps (Git), part 1: Cloud Integration

[ad_1]


Power BI is a powerful tool for creating and sharing interactive data visualizations. But how can you collaborate with other developers on your Power BI projects and ensure quality and consistency across your reports? In this series of blog posts, I will show you how to integrate Power BI with Azure DevOps, a cloud-based software development and delivery platform. We can integrate Azure DevOps with Power BI Service (Fabric) as well as Power BI Desktop.
The current post explains how to set up Azure DevOps and connect a Power BI Workspace.
The next blog post will explain how to use it on your local machine to integrate your Power BI Desktop projects with Azure DevOps.

Before we dive into the details of Power BI and Azure DevOps integration, let’s take a moment to understand what source control systems are and why they are essential for any software project.

Source control systems, also known as version control systems or revision control systems, are tools that help developers manage the changes made to their code over time. They allow developers to track, compare, and roll back changes when necessary and collaborate with other developers on the same project.

There are two main types of source control systems: centralised and distributed. Centralised source control systems use Client-server approach to store all the code and its history in a single server, and developers need to connect to that server to access or modify the code. Examples of centralised source control systems are Microsoft’s Team Foundation Server (TFS) which rebranded to Azure DevOps Server in 2018, IBM’s ClearCase, and Apache’s Subversion.

On the other hand, distributed source control systems use a peer-to-peer approach, allowing each developer to have a local copy of the entire code repository, including its history. Developers can work offline and sync their changes with other developers through a remote server. Examples of distributed source control systems are Git Software and Mercurial, which takes us to the next section. Let’s see what Git is.

Git is one of the world’s most popular and widely used distributed source control systems. It was created by Linus Torvalds, the creator of Linux, in 2005. Git has many advantages over centralised source control systems, such as:

  • Speed: Git is fast and efficient, performing most operations locally without network access.
  • Scalability: Git can easily handle large and complex projects, as it does not depend on a single server.
  • Flexibility: Git supports various workflows and branching strategies, allowing developers to choose how they want to organise their code and collaborate with others.
  • Security: Git uses cryptographic hashes to ensure the integrity and authenticity of the code.
  • Open-source: Git is free and open-source, meaning anyone can use it, modify it, or contribute to it.

While Git is pretty good, it has some disadvantages compared with a centralised source control system. Here are some:

  • Complexity: Git has a steep learning curve, especially for users who are new to distributed version control systems. Understanding concepts such as branching, merging, rebasing, and resolving conflicts can be challenging for beginners and sometimes even seasoned Git users.
  • Collaboration challenges: While distributed version control systems like Git enable easy collaboration, they can also lead to collaboration issues. Multiple developers working on the same branch simultaneously may encounter conflicts that need to be resolved, which can introduce complexities and require extra effort.
  • Performance with large repositories: While Git performs pretty well on most operations, it can get abortive when working with large repositories containing many files or a long history of commits. Operations such as cloning or checking out large repositories can be time-consuming.

Azure DevOps is Microsoft’s cloud-based platform providing a set of tools and services for software development. It encompasses a range of capabilities for managing, planning, developing, testing, and delivering software applications. Azure DevOps offers:

  • Azure Boards: A tool for planning, tracking, and managing work items, such as user stories, tasks, bugs, etc.
  • Azure Repos: A tool for hosting Git repositories online, which is the main focus of this blog post.
  • Azure Pipelines: A tool for automating builds, tests, and deployments.
  • Azure Test Plans: A tool for creating and running manual and automated tests.
  • Azure Artifacts: A tool for managing packages and dependencies.

Azure DevOps also integrates with other tools and platforms, such as GitHub, Visual Studio Code, and now, Power BI. This takes us to the next section of this blog post, Integrating Power BI with Azure DevOps.

Now that we understand what Git and Azure DevOps are let’s see how we can integrate Power BI with Azure DevOps.

Integrating Power BI with Azure DevOps has two different integrations. Cloud integration and local machine integration have the following requirements.

Prerequisites

To follow along with this tutorial, you will need:

  • In the cloud:
    • An Azure DevOps Service
    • A Power BI account with one of the following licenses to enable Power BI Workspace integration with Azure DevOps.:
      • Power BI PPU (Premium Per User)
      • Premium Capacity
      • Embedded Capacity (EM/A)
      • Fabric Capacity
  • On your local machine:
    • The latest version of Power BI Desktop (June 2023 or later)
    • Either Visual Studio or VS Code

As stated earlier, this post explains the Cloud integration partTherefore, we require to have an Azure DevOps Service and a Power BI account with a Premium licencing plan in order to integrate Power BI with Azure DevOps.

In the following few sections, we look into more details and go through them together step-by-step.

Azure DevOps Service

Right off the bat, everyone with a personal Microsoft account (yes, a personal account such as Hotmail, MSN, Outlook, or Live) or an organisational account can use Azure DevOps Service for free (up to 5 users). If you already have an Azure DevOps Service, you can access it via https://aex.dev.azure.com/ to see the existing Organizations after passing you credentials, which looks like the following image:

Azure DevOps Existing Organizations
Azure DevOps Existing Organizations

If this is the first time you’re logging into Azure DevOps, then you will need to provide some more details, as shown in the following image:

First login to Azure DevOps
First login to Azure DevOps

In Azure DevOps, Organization refers to a logical container that hosts a set of projects and resources. It serves as a top-level administrative unit that allows for managing and organising various teams, repositories, pipelines, and other artefacts related to software development and delivery.
As mentioned earlier, everyone can create an Azure DevOps account and consequently create new Organizations. However, this freedom can be restricted. Read more here.

Note:
Organization names are globally unique as their generated URL follows the “https://dev.azure.com/{your_organization_name}” pattern. Therefore, it is crucial to plan for your organisation structure first.

If there are no existing organisations or you do not have access to any, you’ll see the following page:
Azure DevOps Create New Organization
Azure DevOps Create New Organization

Create New Organization in Azure DevOps

Creating a new organization is easy. In the previous image, click the Create new organization button, then follow these steps:

  1. On the Get started with Azure DevOps page, click Continue

Get started with Azure DevOps
Get started with Azure DevOps

  1. Type a name for your Azure DevOps organization
  2. Select a hosting Region. Try to select the same region hosting your Power BI (Fabric) tenant. More on this later
  3. Enter the validation challenge
  4. Click the Continue button

Creating a new organization in Azure DevOps
Creating a new organization in Azure DevOps

  1. Enter a new Project name
  2. Click the Create project button

Creating a new project in Azure DevOps
Creating a new project in Azure DevOps

So far, we have created a new Azure DevOps account, defined an organization, and created a project. We will learn later in this blog that Power BI and Azure DevOps integration happens at the Workspace level. Therefore, using the same project name or similar to the related Workspace makes sense. With that, let’s continue.

  1. Click Repos. Our repo is empty at this stage
  2. Click the Initialize button to initialise the main branch to the repo

Initialize main branch in an Azure DevOps Repo
Initialize the main branch in an Azure DevOps Repo

We are all set now. Next, we need to integrate a Power BI Workspace with our Azure DevOps.

Connect Power BI Workspace to Azure DevOps

Now that we successfully configured Azure DevOps, it is easy to connect Power BI Workspaces to it. As stated earlier, we can only enable this feature on Premium Workspaces (either PPU or a Premium capacity).

If you already have a Premium Workspace, then skip this section. Otherwise, continue reading.

Set Workspaces License

There are multiple ways to set a license to a Workspace. The following steps show one of those methods.

  1. In Power BI Service, click Workspaces
  2. Hover over the desired Workspace and click the ellipsis button
  3. Click Workspace settings
  4. Click the Premium pane
  5. Select the desired license
  6. Click the Apply button

The following image shows the above steps:

Assigning Power BI Workspace to Premium Licenses
Assigning Power BI Workspace to Premium Licenses

Configure Git Integration in Power BI

Now that we have a Premium Workspace, let’s enable the Git Integration feature.

Follow these steps:

  1. From Power BI Service, click Workspaces
  2. Hover over the desired Workspace and click the ellipsis button
  3. Click Workspace settings
  4. Click the Git integration pane
  5. Select an Organization
  6. Select the desired Project
  7. Select a Git repository
  8. Select a Branch
  9. Enter the name of the Git folder you want to integrate the supported Power BI artefacts
  10. Click the Connect and sync button

Spoiler alert! You have to be an admin to fix this, so if you aren’t, please contact your administrators, and they should be able to fix it for you. If you do not get any errors, continue reading.

  1. Power BI asks for your confirmation if the folder does not exist. Click the Create and sync button

The following image shows the preceding steps:

Git integration on a Power BI Premium Workspace
Git integration on a Power BI Premium Workspace

After successfully synchronising the supported Power BI items in the Workspace with the Git repository, you should see something like the following image showing the items that are synced and not supported.

Power BI Premium Workspace after syncing with Git repo on Azure DevOps
Power BI Premium Workspace after syncing with Git repo on Azure DevOps

As you see, this page has a few changes, such as:

  1. A new Git status added to the list view in the Workspace
  2. A new Source control pane added
  3. Git sync information on the status bar showing the Connected branch (the main branch in our example), the Last synced time, and a link to the last Commit that the Workspace is in sync with.

Resolving the “Unable to connect to Git branch. This workspace is in a different region. Go to the workspace admin settings to enable cross-region connections.” error

As pointed out in the previous section, you may get the following error message when clicking the Connect and sync button to integrate your Workspace with Azure DevOps:

Unable to connect to Git branch. This workspace is in a different region. Go to the workspace admin settings to enable cross-region connections. error in Power BI
Fixing the Unable to connect to Git branch error in Power BI

If you face this error, it means that your Power BI tenant is in a different region than your Azure DevOps. That’s why I mentioned earlier that it is best to select the same region as your Power BI tenant when creating the Azure DevOps Organization. To fix this issue, you must be a Fabric Administrator. If you aren’t an admin, contact your administrator(s) to fix the issue. Otherwise, follow these steps:

  1. Click the Settings gear from the top right of your browser

Note:

Depending on your screen resolution, you may see an ellipsis button on the top right of your browser. Click the ellipsis button, then click Settings.

  1. Click Admin portal
  2. Scroll all the way down from the Tenant settings tab to find the Git integration section. Expand the Users can export items to Git repositories in other geographical locations (Preview) setting
  3. Click to toggle button to Enable it. (In my example, I enabled this feature to The entire organization. You may enable it only for Specific security groups.)
  4. Click the Apply button

The following image shows these steps:
Enabling Users can export items to Git repositories in other geographical locations feature in the Fabric Admin Portal
Enabling Users can export items to Git repositories in other geographical locations feature in the Fabric Admin Portal

Now that we have allowed Git repositories to reside in a different geographical location than our Power BI tenant, we can continue the configuration from where we left off.

This post aims to cover all aspects of Integrating Power BI Premium Workspaces with Git repositories on Azure DevOps. I will publish a separate post on using this integration to synchronise our codes between Power BI Service in the cloud and the Power BI Desktop project on our local machine.

Stay tuned!

[ad_2]

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *