Skip to main content

Power BI and the data.world Collector

Note

The latest version of the Collector is 2.128. To view the release notes for this version and all previous versions, please go here.

About the collector

Use this collector to harvest metadata from PowerBI. Users can then:

  • Discover Power BI reports and dashboards across your enterprise’s Power BI workspaces.

  • Perform impact analysis to understand how changes to upstream data sources impact Power BI reports.

Version supported

The collector supports Power BI Cloud API v 1.0.

Authentication supported

There are two separate ways to authenticate to Power BI:

  • Service principal

  • User and password

The collector will harvest metadata for all Power BI apps and workspaces to which the supplied account has access.

What is cataloged

The collector catalogs the following information.

Table 1.

Object

Information collected

Workspaces

Title

Apps

Title

Reports

Title, External URL, Embed URL

Report Pages

Title

Dashboards

Title, External URL, Embed URL

Dashboard tiles

Title, External URL, Embed URL

Data Sources

Title, Data source type

Datasets

Title, External URL

Dataflows

Title, Last modified, Description

Power BI Tables (Datasets and Dataflows)

Title, Is hidden, Description

Power BI Columns

Title, Data type, Column type, Data category, Is hidden, Expression

File

File path, File name

File directory

Directory path



Relationships between objects

By default, the data.world catalog will include catalog pages for the resource types below. Each catalog page will have a relationship to other related resource types. Note that the catalog presentation and relationships are fully configurable, so these will list the default configuration.

Table 2.

Resource page

Relationship

Power BI Column

Power BI Table

Data source

App, dataset, dataflow

Tile

Dashboard, report, dataset

Dashboard

Tile, workspace

Report

Tile, Workspace, report pages, dataset

Report Pages

Report

Dataset

Tile, workspace, report, table, data source, Dataflow

Workspace

Report, dataset, dataflow, dashboard

Dataflow

Workspace, table, dataset, data source

Power BI Table

Dataset, Dataflow, Power BI Column



Lineage for PowerBI

The following lineage information is collected by the PowerBI collector.

Table 3.

Object

Lineage available

Report

Associated dataset

Dashboard Tile

Associated dataset

Dataset

Associated Dataflow, Dashboard Tile, Report, and Dataset

Dataflow

Associated Column, dataset, and dataflow

Column

Associated columns that the column sources its data from or calculates its values from



Important things to note

  • Power BI does not includeing user workspace when using Service Principal authentication.

  • If both workspace-include and workspace-exclude are specified, included workspaces take precedence.

  • Dataflows require the user/service principal to be added to the workspace with at least contributor access. When authenticating with username/password, the app registration needs to have least Dataflow.Read.All permissions in API permissions.

  • Only administrators of the tenant can grant admin consent.

Setting up access for cataloging Power BI resources

Authentication types supported

There are two separate ways to authenticate to Power BI:

  • Service principal

  • User and password

This section will walk you through the process for both authentication types. All these tasks are performed on the Azure Portal.

STEP 1: Registering your application

To register a new application:

  1. Select Azure Active Directory.

  2. Click the App Registrations option in the left sidebar.

  3. Click New Registration and enter the following information:

    1. Application Name: DataDotWorldPowerBIApplication

    2. Supported account types: Accounts in this organizational directory only

  4. Click Register to complete the registration.

STEP 2: Creating Client secret and getting the Client ID

To create a Client Secret:

  1. On the application page, select Certificates and Secrets.

  2. Click on Secret and add a description.

  3. Set the expiration to Never.

  4. Click on Create, and copy the secret value.

To get the Client ID from the Azure portal:

  1. Click on the Overview tab in the left sidebar of the application home page.

  2. Copy the Client ID from the Essentials section.

STEP 3: Setup metadata scanning

Enable access to the detailed data source information (like tables and columns) provided by Power BI through the read-only admin APIs. For details about doing this task, please see this documentation.

STEP 4: Setting up REST API for service principals

Important

Perform this task only if you are using the service principal for authentication.

If you are using service principal as your authentication type, ensure that you enable service principals to use the Power BI APIs. For detailed instructions for doing this task, please see this documentation.

STEP 5: Setting up permissions for username & password authentication

Important

Perform this task only if you are using user and password for authentication.

To add permissions:

  1. Click on API Permissions, and select Add Permission.

  2. Search for the Microsoft Graph and select the following permissions:

    • Application permission: Application.Read.All

    • Delegated permission: User.Read (assigned by default)

  3. Search for the Power BI service, and click on Delegated permissions. Select the following permissions:

    • App.Read.All

    • Dashboard.Read.All

    • Dataflow.Read.All

    • Dataset.Read.All

    • Report.Read.All

    • Tenant.Read.All

    • Workspace.Read.All

  4. Click on the Grant Admin consent button, which is located next to the Add permission button. This allows the data.world collector to run as a daemon without having to ask the user permission on every crawler run.

Note

Only administrators of the tenant can grant admin consent.

Pre-requisites for running the collector

Table 4.

Item

Requirement

Hardware

RAM

8 GB

CPU

2 Ghz processor

Software

Docker

Click here to get Docker.

Java Runtime Environment

OpenJDK 17 is supported and available here.

data.world specific objects

Dataset

You must have a ddw-catalogs (or other) dataset set up to hold your catalog files when you are done running the collector.



Generating the command or YAML file

This section walks you through the process of generating the command or YAML file for running the collector from Windows or Linux or MAC OS.

To generate the command or YAML file:

  1. On the Organization profile page, go to the Settings tab > Metadata collectors section.

  2. Click the Help me set up a collector button.

  3. On the On-prem collector setup prerequisites screen, read the pre-requisites and click Next.

  4. On the On which platform will this collector execute? screen, select if you will be running the collector on Windows or Mac OS or Linux. This will determine the format of the YAML and CLI command that is generated in the end. Click Next.

    general_01.png
  5. On the Choose metadata collector type you would like to setup screen, select PowerBI. Click Next.

  6. On the Configure a new on premises PowerBI screen, set the following properties and click Next.

    powerbi_01.png
    Table 5.

    Field name

    Corresponding parameter name

    Description

    Required?

    data.world API token

    -t= <apiToken>

    --api-token= <apiToken>

    The data.world API token to use for authentication. Default is to use an environment variable named ${DW_AUTH_TOKEN}.

    Yes

    Output Directory

    -o= <outputDir>

    --output= <outputDir>

    The output directory into which any catalog files should be written.

    Yes

    Collection Name

    -n= <catalogName>

    -n= <catalogName>

    The name of the collection where the collector output will be stored.

    Yes

    Automatic upload location

    --upload-location= <uploadLocation>

    The dataset to which the catalog is to be uploaded. You can specify a simple dataset name to upload to that dataset within the organization's account, or [account/dataset] to upload to a dataset in some other account.

    Yes

    data.world API host

    -H= <apiHost>

    --api-host= <apiHost>

    The host for the data.world API. NOTE: This parameter is required for single-tenant installations only. For example, api.8bank.data.world" where 8bank is the name of the single-tenant install.)

    Yes

    (for single-tenant installations)



  7. On the next screen, set the following properties and click Next.

    powerbi_02.png
    Table 6.

    Field name

    Corresponding parameter name

    Description

    Required?

    Select from one of the following authentication options.

    Yes

    Option 1: Authenticate using Azure Username & Password

    Azure Username

    --azure-username= <username>

    Azure Active Directory username for Power BI Cloud authentication.

    Yes

    Azure Password

    --azure-password= <password>

    Azure Active Directory password for Power BI Cloud authentication. By default this is set as an environment variable. ${DW_AZURE_PASSWORD}

    Yes

    Option 2: Authenticate using Azure tenant ID (Service principal)

    Azure Tenant Id

    --azure-tenantid= <tenantId>

    Azure Active Directory application tenant id for Power BI app. To find the tenant ID, click the question mark in the Power BI app and then choose About Power BI. The tenant ID will be found at the end of the Tenant URL.

    Yes

    Client ID and Client secret

    Azure Client ID

    --azure-clientid= <clientId>

    Azure Active Directory application client ID for Power BI app.

    Yes

    Azure Client Secret

    --azure-secret= <clientSecret>

    Azure Active Directory application client secret for Power BI app. By default this is set as an environment variable ${DW_AZURE_SECRET}.

    Yes



  8. On the next screen, set the following optional properties and click Next.

    powerbi_03.png
    Table 7.

    Field name

    Corresponding parameter name

    Description

    Required?

    Skip harvesting lineage metadata

    --disable-expression-lineage

    Skip harvesting lineage metadata from Power BI source expressions.

    No

    Catalog contents of user's My Workspace

    --include-user-workspace

    --user-workspace-include

    Catalog contents of user's My Workspace in Power BI (Default is to skip the user's workspace).

    No

    Include PowerBI Workspace(s)

    --include-workspace= <includedWorkspaceNames>

    --workspace-include= <includedWorkspaceNames>

    Include the specified Power BI workspace's contents in the catalog. Use the parameter multiple times for multiple workspaces. For example, --workspace-include="workspaceA" --workspace-include="workspaceB"

    No

    Exclude PowerBI Workspaces

    --exclude-workspace=<excludedWorkspaceNames>

    --workspace-exclude= <excludedWorkspaceNames>

    Exclude the specified Power BI workspace's contents from the catalog. Use the parameter multiple times for multiple workspaces. For example, --workspace-exclude="workspaceA" --workspace-exclude="workspaceB". If both --include-workspace and --exclude-workspace are used, --include-workspace takes precedence.

    No



  9. On the Finalize your PowerBI Collector configuration screen, you are notified about the environment variables and directories you need to setup for running the collector.

    Important

    You must ensure that you have set up these environment variables and directories before you run the collector.

    powerbi_04.png
  10. Next, select if you want to generate a Configuration file( YAML) or Command line arguments (CLI). Click Next

  11. The next screen gives you an option to download the YAML configuration file or copy the CLI command. Click Done. If you are generated a YAML file, click Next.

    powerbi_05.png

    Sample YAML file.

    powerbi_06.png
  12. The powerBI command screen gives you the command to use for running the collector using the YAML file.

    powerbi_07.png
  13. You will notice that the YAML/CLI has following additional parameters that are automatically set for you.

    Table 8.

    Parameter name

    Details

    Required?

    -b= <base>

    --base= <base>

    The base URI to use as the namespace for any URIs generated.

    (Must use this OR --agent)

    Yes

    (If agent is not provided)

    -a=<agent>

    --agent=<agent>

    --account=<agent>

    The CLI and YAML file incudes the base parameter. If you want, you can instead use the agent parameter.

    The ID for the data.world account into which you will load this catalog - this is used to generate the namespace for any URIs generated.

    (Must include either --agent or --base)

    Yes

    (if base parameter is not provided)

    --site= <site>

    This parameter should be set only for Private instances. Do not set it for public instances and single-tenant installations. Required for private instance installations.

    Yes (required for private instance installations)

    -L

    --no-log-upload

    Do not upload the log of the Collector run to the organization account's catalogs dataset or to another location specified with --upload-location(ignored if --upload not specified)

    Yes

    dwcc: <CollectorVersion>

    The version of the collector you want to use (For example, datadotworld/dwcc:2.113)

    yes



  14. Add following additional parameter to test run the collector.

    • --dry-run If specified, the collector does not actually harvest any metadata, but just checks the database connection parameters provided by the user and reports success or failure at connecting.

  15. Add the following parameter if you are using a sparql query to execute to transform the catalog graph emitted by the collector

    • -z=<postProcessSparql>--post-process-sparql=<postProcessSparql> : A file containing a SPARQL query to execute to transform the catalog graph emitted by the collector

Verifying environment variables and directories

  1. Verify that you have set up all the required environment variables that were identified by the Collector Wizard before running the collector. Alternatively, you can set these credentials in a credential vault and use a script to retrieve those credentials.

  2. Verify that you have set up all the required directories that were identified by the Collector Wizard.

Running the collector

Important

Before you begin running the collector make sure you have the correct version of collectors downloaded and available.

Running collector using YAML file

  1. Go to the server where you have setup docker to run the collector.

  2. Make sure you have download the correct version of collectors. This version should match the version of the collector specified in the YAML/CLI generated from the collector wizard.

  3. Place the YAML file generated from the Collector wizard to the correct directory.

  4. From the command line, run the command generated from the application for executing the YAML file.

    Caution

    Note that is just a sample command for showing the syntax. You must generate the command specific to your setup from the application UI.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \
      --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc -e DW_AUTH_TOKEN=${DW_AUTH_TOKEN} \
      -e DW_AZURE_PASSWORD=${DW_AZURE_PASSWORD} -e DW_AZURE_SECRET=${DW_AZURE_SECRET} \
      datadotworld/dwcc:2.124 --config-file=/dwcc-output/config-powerbi.yml
  5. The collector automatically uploads the file to the specified dataset and you can also find the output at the location you specified while running the collector.

  6. At a later point, if you download a newer version of collector from docker, you can edit the collector version in the generated command to run the collector with the newer version.

Running collector without the YAML file

  1. Go to the server where you have setup docker to run the collector.

  2. Make sure you have download the version of collectors from here.

  3. From the command line, run the command generated from the application. Here is a sample command.

    Caution

    Note that is just a sample command for showing the syntax. You must generate the command specific to your setup from the application UI.

    docker run -it --rm --mount type=bind,source=${HOME}/dwcc,target=/dwcc-output \
      --mount type=bind,source=${HOME}/dwcc,target=${HOME}/dwcc datadotworld/dwcc:2.124 \
      catalog-powerbi --base=https://carsrus.linked.data.world/d/ddw-catalogs/ \
      --no-log-upload=false --upload=true --api-token=${DW_AUTH_TOKEN} \
      --output=/dwcc-output --name=carsrus-collection --upload-location=ddw-catalogs \
      --azure-username=my_user_name --azure-password=${DW_AZURE_PASSWORD} \
      --azure-clientid=my_client_id --azure-secret=${DW_AZURE_SECRET} \
      --disable-expression-lineage=false --include-user-workspace=true \
      --include-workspace=workspaceA
  4. The collector automatically uploads the file to the specified dataset and you can also find the output at the location you specified while running the collector.

  5. At a later point, if you download a newer version of collector from docker, you can edit the collector version in the generated command to run the collector with the newer version.

Collector runtime and troubleshooting

The catalog collector may run in several seconds to many minutes depending on the size and complexity of the system being crawled. If the catalog collector runs without issues, you should see no output on the terminal, but a new file that matching *.dwec.ttl should be in the directory you specified for the output. If there was an issue connecting or running the catalog collector, there will be either a stack trace or a *.log file. Both of those can be sent to support to investigate if the errors are not clear. A list of common issues and problems encountered when running the collectors is available here.

Automating updates to your metadata catalog

Keep your metadata catalog up to date using cron, your Docker container, or your automation tool of choice to run the catalog collector on a regular basis. Considerations for how often to schedule include:

  • Frequency of changes to the schema

  • Business criticality of up-to-date data

For organizations with schemas that change often and where surfacing the latest data is business critical, daily may be appropriate. For those with schemas that do not change often and which are less critical, weekly or even monthly may make sense. Consult your data.world representative for more tailored recommendations on how best to optimize your catalog collector processes.