Add Pixies to your reports with the Fabric API
BI Pixie can add Pixies to your target reports in three ways:
- Manually or externally: You bring your reports and semantic models to a local folder, and then you run BI Pixie Desktop (
bi-pixie.exe) on that target folder, as described in Add Pixies to your reports. - Using Git: You connect BI Pixie Desktop to your Git or GitHub repository. BI Pixie Desktop pulls the definitions of your reports and semantic models, and can commit and push the reports with Pixies to the repository and to the Power BI workspaces that are connected to Git, as described in Add Pixies with Git.
- Via Microsoft Fabric API: You tell BI Pixie which workspaces and reports to use. BI Pixie loads the definitions of the reports and semantic models with the Get Item Definition API and stores the files locally. BI Pixie then adds Pixies to the reports and semantic models and updates their definitions in their workspaces.
This article covers adding Pixies through the Microsoft Fabric API. BI Pixie connects to your Power BI service through the Fabric API, so that adding Pixies fits into your existing report deployment process.
Before you start
- Set the required configuration parameters, as described in Add Pixies to your reports.
- Install Azure CLI for Windows on the machine where you run 'bi-pixie.exe', and sign in to Azure with 'az login' before the first run.
How it works
You can connect BI Pixie Desktop to Microsoft Fabric and the Power BI service, so that BI Pixie exports the definitions of your reports and semantic models automatically and imports the items with Pixies back into your workspaces.
You tell BI Pixie which workspaces to use, and which reports to include or exclude. BI Pixie loads the definitions of the reports and semantic models with the Get Item Definition API and stores the files locally. BI Pixie then adds Pixies to the reports and semantic models locally, and can update the changes in the workspaces.
Set up BI Pixie for the Fabric API
- Open the
bi_pixie_config.jsonfile. Make sure that you have already set the required parameters, as described in Add Pixies to your reports. - Set
use_report_folder_as_projecttotrue. - Under
fabric_settings, find the parameters below and set them totrue:enable_workspace_contextauto_mapping_folders_to_workspacesload_items_using_fabric_apisave_items_using_fabric_api
- Optionally, to test the reports locally before BI Pixie updates them in the service, set
save_items_using_fabric_apitofalseinstead. - Use the workspace and report parameters to define which workspaces and reports to include or exclude, as explained in this table:
| Parameter Name | Description | Example |
include_all_workspaces | When set to false, you list the IDs of the workspaces you want to use in the include_workspace_ids array parameter below.When set to true, which we do not recommend because of API limits, BI Pixie reads the item definitions of reports and semantic models from every workspace, except the workspaces you list in the exclude_workspace_ids array. | "fabric_settings": { |
exclude_workspace_ids | Use this array parameter when include_all_workspaces is set to true. BI Pixie then reads metadata from every workspace except the ones listed. | "exclude_workspace_ids": [ |
include_workspace_ids | Use this array parameter when include_all_workspaces is set to false. BI Pixie then reads metadata from the listed workspaces only, rather than from every workspace in the tenant.If you use Power BI Deployment Pipelines, we recommend listing only the Test workspaces here. | "include_workspace_ids": [ |
include_all_reports | When this Boolean parameter is set to true, BI Pixie reads metadata from every report in the target workspaces defined above.When it is set to false, you list the report IDs in the include_report_ids array parameter below. | "fabric_settings": { |
exclude_report_ids | Use this array parameter when include_all_reports is set to true. BI Pixie then reads metadata from every report in the target workspaces except the ones listed. | "exclude_report_ids": [ |
include_report_ids | Use this array parameter when include_all_reports is set to false. BI Pixie then reads metadata from the listed reports only, rather than from every report in the target workspaces.Note: You don't need to list the semantic model IDs. | "include_report_ids": [ |
- Run
bi-pixie.exe. - You can find the local reports with Pixies in the BI Pixie Repository subfolder. To test the reports before you publish them, see Test your reports with Pixies. You may need to refresh the reports first when you open them locally.
- If you set
save_items_using_fabric_apitotrue, you can now open the reports in the Power BI service and confirm that BI Pixie tracks their usage.
Every time you change your reports, you can run BI Pixie Desktop again with the same setup. On each run, BI Pixie empties each workspace's subfolder under BI Pixie Repository and loads the current definitions into it, so any change you make to the files there is lost on the next run.
Using Deployment Pipelines
If you use Deployment Pipelines in Power BI, you can set BI Pixie to load the definitions from your Test stage while the original reports stay in the Development stage. After you run BI Pixie, you can test the reports in the Test workspace in the Power BI service, and then deploy them to the Production stage with the Deployment Pipeline feature in Power BI.
The following diagram shows how BI Pixie fits into your existing process with a Power BI deployment pipeline.
You can follow these steps for each deployment pipeline:
- Get the ID of the workspace assigned to your Test stage. To find it, browse to the workspace from the Test stage on the deployment pipeline page, and read the workspace ID in the browser's address bar. For example, here is the highlighted workspace ID:
https://app.powerbi.com/groups/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/list?experience=power-bi. - Add the workspace ID to the
include_workspace_idsparameter. You can also include or exclude individual report IDs. - Every time the original reports change in your Development stage, deploy the changes to the Test stage, through the Power BI Deployment Pipelines interface or its APIs. This is step 1 in the diagram above.
- Run BI Pixie Desktop. BI Pixie loads the definition files of your reports from the Test workspace and updates the items there with Pixies. This is step 2 in the diagram above.
- Test the reports in the Test workspace.
- Deploy the reports with Pixies from Test to Production, through the Power BI Deployment Pipelines interface or its APIs. This is step 3 in the diagram above.