Uredi

Deli z drugimi prek


Tutorial: Lifecycle management in Fabric

In this tutorial, you go through the whole process of loading data into your workspace, and using deployment pipelines together with Git integration to collaborate with others in the development, testing, and publication of your data and reports.

Note

Some of the items for Git integration are in preview. For more information, see the list of supported items.

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 one of the following:

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 account registered to the same user that is using the Fabric workspace. Create a free account.
  • Access to an existing repository.
  • Download the FoodSales.pbix file into a Git repo that you can edit. We use this sample file in this tutorial. Alternatively, you can use your own semantic model and report, if you prefer.

If you already have admin rights to a workspace with data, you can skip to step 3.

Step 1: Create a Premium workspace

To create a new workspace and assign it a license:

  1. From the left navigation bar of the Power BI experience, select Workspaces > + New workspace.

    Screenshot of Create workspace user interface.

  2. Name the workspace FoodSalesWS.

  3. (Optional) Add a description.

    Screenshot of new workspace with name. The name is FoodSalesWS.

  4. Expand the Advanced section to reveal License mode.

  5. Select either Trial or Premium capacity.

    Screenshot of new workspace with license mode.

  6. Select Apply.

For more on creating a workspace, see Create a workspace.

Step 2: Load content into the workspace

You can upload content from OneDrive, SharePoint, or a local file. In this tutorial, we load a .pbix file.

  1. From the top menu bar, select Upload > Browse.

    Screenshot of Upload menu user interface.

  2. Browse to the location of the FoodSales.pbix file you downloaded earlier, or load your own sample semantic model and report.

You now have a workspace with content in it for you and your team to work on.

Screenshot of FoodSalesWS workspace with a report, semantic model, and dashboard in it.

Edit credentials - first time only

Before you create a deployment pipeline, you need to set the credentials. This step only needs to be done once for each semantic model. After your credentials are set for this semantic model, you won't have to set them again.

  1. Go to Settings > Power BI settings.

    Screenshot of Settings menu user interface.

  2. Select Semantic models > Data source credentials > Edit credentials.

    Screenshot of Data source credentials menu.

  3. Set the Authentication method to Anonymous, the Privacy level to Public, and uncheck the Skip test connection box.

    Screenshot of semantic model credentials.

  4. Select Sign in. The connection is tested and credentials set.

You can now create a deployment pipeline.

Step 3: Connect the team's development workspace to git

The entire team shares this workspace and each member of the team can edit it. By connecting this workspace to git, you can keep track of all the changes and revert back to previous versions if necessary. When all the changes are merged into this shared branch, deploy this workspace to production using the deployment pipeline.
Read more about version control with Git in Introduction to Git integration.

Let's connect this workspace to the main branch of your Git repo so all team members can edit it and create pull requests. Follow these steps if you're using an Azure DevOps repo. If you're using a GitHub repo, follow the directions in Connect a workspace to a GitHub repo.

  1. Go to Workspace settings in the top right corner.

  2. Select Git integration.

  3. Select Azure DevOps. You’re automatically signed into the Azure Repos account registered to the Microsoft Entra user signed into the workspace.

    Screenshot of workspace with workspace settings link displayed.

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

    • Organization

    • Project

    • Git repository

    • Select main (or master) branch

    • Type the name of folder in the repo where the .pbix file located. This folder will be synced with the workspace.

      Screenshot of workspace settings Git integration window with workspace connected to main branch of repo.

  5. Select Connect and sync.

After you connect, the Workspace displays information about source control that allows you to view the connected branch, the status of each item in the branch and the time of the last sync. The Source control icon shows 0 because the items in the workspace Git repo are identical.

Screenshot of source control icon and other Git information.

Now the workspace is synced with the main branch of your Git repo making it easy to keep track of changes.

For more information about connecting to git, see Connect a workspace to an Azure repo.

Step 4: Create a deployment pipeline

In order to share this workspace with others and use it for various stages of testing and development, we need to create a deployment pipeline. You can read about how deployment pipelines work in Introduction to deployment pipelines. To create a deployment pipeline and assign the workspace to the development stage, do the following steps:

  1. From the workspace home page, select Create deployment pipeline.

    Screenshot of Create deployment pipeline.

  2. Name your pipeline FoodSalesDP, give it a description (optional) and select Next.

    Screenshot of how to create a new pipeline with name.

  3. Accept the default three stages to your pipeline, and select Create.

    Screenshot of three default stage of a deployment pipeline.

  4. Assign the FoodSalesWS workspace to the Development stage.

    Screenshot of how to assign a workspace.

The development stage of the deployment pipeline shows one semantic model, one report, and one dashboard. The other stages are empty.

Screenshot of Development stage.

You can read more about creating deployment pipelines in Deployment pipelines overview.

Step 5: Deploy content to other stages

Now, deploy the content to the other stages of the pipeline.

  1. From the development stage of the deployment content view, select Deploy.

    Screenshot of Deploy to test stage.

  2. Confirm that you want to deploy the content to the test stage.

    Screenshot of Confirm deploy.

    The green check icon indicates that the contents of the two stages are identical, since you deployed the entire content of the pipeline.

    Screenshot of Development stage and test stage of pipelines with a green check icon indicating they're the same.

  3. Deploy the content from the test stage to the production stage.

    Screenshot of Deploy to production stage.

  4. To refresh the semantic model in any stage, select the refresh button next to the semantic models icon in the summary card of each stage.

    Screenshot of Refresh button.

The entire team shares this deployment pipeline. Each team member can edit the semantic model and report in the development stage. When the team is ready to test the changes, they deploy the content to the test stage. When the team is ready to release the changes to production, they deploy the content to the production stage.

For more information on deploying content, see Deploy content.

Step 6: Create an isolated workspace

In order to avoid editing the shared workspace and interfering with other team members' changes, each team member should create their own isolated workspace to work in until they're ready to share their changes with the team.

  1. From the branch tab of the Source control menu, select the down arrow next to the current branch name, and select Branch out to new workspace.

    Screenshot of source control branch out option.

  2. Specify the following details about the branch and workspace. The new branch is automatically created based on the branch connected to the current workspace.

    • Branch name (for this tutorial, name it MyFoodEdits)
    • Workspace name (for this tutorial, name it My_FoodSales)

    Screenshot of branch out specifying the name of the new branch and workspace.

  3. Select Branch out.

  4. Select Connect and sync.

Fabric creates the new workspace and syncs it to the new branch. You're automatically taken to the new workspace, but the sync might take a few minutes.

The new workspace now contains the content of the Git repo folder. Notice it doesn't contain the .pbix file. Since .pbix files are unsupported, this file wasn't copied to the Git repo when we synced.
Use this workspace to make changes to the semantic model and report until you're ready to share them with your team.

Step 7: Edit the workspace

Once the branched out workspace is synced, you can make changes to the workspace by creating, deleting, or editing an item. In this tutorial, we change the format of a semantic model column. You can edit the workspace in Power BI Desktop or data model. In this tutorial, we edit the workspace from the data model.

  1. From the semantic model workspace, select the semantic model ellipsis (three dots) > Open data model.

    Screenshot of open data model in the expanded semantic model menu.

    Note

    If Open data model is disabled, go to Workspace settings > Power BI > General and enable Data model settings.

    Screenshot of data model settings check box.

  2. From the Order_details table, select Discount.

    Screenshot of connected tables in the data view with the discount column of the Order Details table selected.

  3. From the Properties pane, change the Format from General to Percentage.

    Screenshot of publishing changes in Git.

Step 8: Commit changes

To commit this change from the workspace into the Git branch, go back to the workspace home page.

The source control icon now shows 1 because one item in the workspace was changed but not committed to the Git repo. The FoodSales semantic model shows a status of Uncommitted.

Screenshot of source control icon showing one uncommitted change.

  1. Select the source control icon to view the changed items in the Git repo. The semantic model shows a status of Modified.

  2. Select the item to commit and add an optional message.

  3. Select Commit.

    Screenshot of committing changes user interface.

The Git status of the semantic model changes to Synced and the workspace and Git repo are in sync.

Step 9: Create PR and merge

In the Git repo, create a pull request to merge the MyFoodEdits branch with the main branch.

  1. Select Create a pull request.

    Screenshot of create pull request user interface.

  2. Provide a title, description, and any other information you want for the pull request. Then select Create.

    Screenshot of naming pull request and adding description.

  3. Merge the pull request.

    Screenshot of merge pull request interface.

Once the changes have been merged to the main branch, you can safely delete the workspace, if you want. It's not deleted automatically.

Step 10: Update shared workspace

Go back to the shared workspace connected to the dev stage of the deployment pipeline (the one we created in Step 1) and refresh the page.
The source control icon now shows 1 because one item in the Git repo was changed and is different from the items in the FoodSales workspace. The FoodSales semantic model shows a status of Update required.

Screenshot of source control icon showing one difference.

  1. Select the source control icon to view the changed items in the Git repo. The semantic model shows a status of Modified.

  2. Select Update all.

    Screenshot of the update workspace user interface.

The Git status of the semantic model changes to Synced and the workspace is synced with the main Git branch.

Step 11: Compare stages in deployment pipeline

  1. Select View deployment pipeline to compare the content in the development stage with the content in the test stage.

    Screenshot of View deployment pipelines icon.

    Notice the orange X icon between the stages indicating that changes were made to the content in one of the stages since the last deployment.

    Screenshot showing pipeline stages are different.

  2. Select the down arrow > Review Changes to view the changes. The Change Review screen shows the difference between the semantic models in the two stages.

    Screenshot of change review user interface.

  3. Review the changes and close the window.

For more information about comparing stages in a deployment pipeline, see Compare stages in a deployment pipeline.

Step 12: Deploy to test stage

When you’re satisfied with the changes, deploy the changes to the test and/or production stages using the same process you used in Step 5.

Summary

In this tutorial, you learned how to use deployment pipelines along with Git integration to manage the lifecycle of an app, report, or other content in a workspace.
In particular, you learned how to:

  • Set up your workspaces and add content for managing their lifecycle in Fabric.
  • Apply Git best practices to work alone and collaborate with teammates on changes.
  • Combine Git and deployment pipelines for an efficient end to end release process.