Running the Power BI Gov collector on-premise
Note
The latest version of the Collector is 2.248. To view the release notes for this version and all previous versions, please go here.
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:
On the Organization profile page, go to the Settings tab > Metadata collectors section.
Click the Add a collector button.
On the Choose metadata collector screen, select the correct metadata source. Click Next.
On the Choose where the collector will run screen, in the On-premise section, 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 that is generated in the end. Click Next.
On the On-prem collector setup prerequisites screen, read the pre-requisites and click Next.
On the Configure an on-premises PowerBI Gov screen, set the following properties and click Next.
On the next screen, set the following properties and click Next.
Table 2.Field name
Corresponding parameter name
Description
Required?
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
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
On the next screen, set the following advanced properties and click Next.
Table 3.Field name
Corresponding parameter name
Description
Required?
Catalog contents of user's My Workspace
--include-user-workspace
--user-workspace-include
Catalog contents of user's My Workspace in PowerBI. Default is to skip the user's workspace.
No
Catalog all workspaces and apps in tenant
--all-workspaces-and-apps
Catalog all workspaces and apps in a tenant, rather than only the workspaces and apps the credentials used have explicit access to. This option only works if the credentials used have admin privileges.
No
Disable Lineage collection
--disable-expression-lineage
Skip harvesting lineage metadata from Power BI source expressions.
No
Include PowerBI Workspaces
--include-workspace= <includedWorkspaceNames>
--workspace-include= <includedWorkspaceNames>
Specify the workspaces to be collected, using either a workspace name or a regular expression to match.
Use the parameter multiple times for multiple workspaces. For example,
--workspace-include="workspaceA"
--workspace-include="workspaceB"
Note: If the workspace name includes special characters [. , + , * , ? , ^ , $ , ( , ) , [ , ] , { , } , | , \], use a backslash (\)before the special character to escape them. For instance, Workspace [Dev] should be changed to Workspace \[Dev\].
No
Exclude PowerBI Workspaces
--exclude-workspace= <excludedWorkspaceNames>
--workspace-exclude= <excludedWorkspaceNames>
Specify the Power BI workspaces and contents to exclude from being cataloged, using either a workspace name or a regular expression to match.
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.
Note: If the workspace name includes special characters [. , + , * , ? , ^ , $ , ( , ) , [ , ] , { , } , | , \], use a backslash (\)before the special character to escape them. For instance, Workspace [Dev] should be changed to Workspace \[Dev\].
No
On the next screen, set the following advanced properties and click Next.
Table 4.Field name
Corresponding parameter name
Description
Required?
Maximum Power BI Expression Length
--max-parseable-expression-length= <maxParseableExpressionLength>
Set the maximum number of characters in a Power BI expression that will be parsed for lineage metadata. Expressions longer than this will be skipped. Default is 32000.
No
Datasource name mapping file
--datasource-mapping-file= <datasourceFile location>
Provide the location of the file, if you have configured ODBC source details in the datasources.yml file.
Note: You should have placed your datasources.yml file in the source directory of your host machine. The value in this field is relative to the mount location of the container (target). For example, if you have a mount target set to /dwcc-output, the value for --datasource-mapping-file will be /dwcc-output/datasources.yaml.
No
Catalog report preview images
--image-collection=<true_or_false>
Specify if the collector should catalog preview images. The default setting is false. Ensure that you have completed all the pre-requisites for using this feature.
No
Disable max requests wait
--disable-max-requests-wait= <true_or_false>
Disable waiting up to an hour for the Power BI API to reset throttling limits (error code 429 - too many requests). When not disabled, the collector retries every 5 minutes for up to an hour. If this option is disabled, the Max retries and Retry delay options will be used instead.
No
Max retries
--api-max-retries= <maxRetries>
Specify the number of times to retry an API call which has failed. The default value is 5.
No
Retry delay
--api-retry-delay= <retryDelay>
Specify the amount of time in seconds to wait between retries of an API call which has failed. The default is to try with a delay of 2 seconds between each call.
No
On the next screen, provide the Collector configuration name. This is the name used to save the configuration details. The configuration is saved and made available on the Metadata collectors summary page from where you can edit or delete the configuration at a later point. Click Save and Continue.
On the Finalize your PowerBI Gov Collector configuration screen, you are notified about the environment variables and directories you need to setup for running the collector.Select if you want to generate a Configuration file( YAML) or Command line arguments (CLI). Click Next.
Important
You must ensure that you have set up these environment variables and directories before you run the collector.
The next screen gives you an option to download the YAML configuration file or copy the CLI command. Click Done. If you are generating a YAML file, click Next.
Sample YAML file.
The PowerBI Gov command screen gives you the command to use for running the collector using the YAML file.
You will notice that the YAML/CLI has following additional parameters that are automatically set for you.
Important
Except for the collector version, you should not change the values of any of the parameter listed here.
Table 5.Parameter name
Details
Required?
-a= <agent>
--agent= <agent>
--account= <agent>
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.
Yes
--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)
-U
--upload
Whether to upload the generated catalog to the organization account's catalogs dataset.
Yes
dwcc: <CollectorVersion>
The version of the collector you want to use (For example,
datadotworld/dwcc:2.113)
Yes
Add the 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.
Verifying environment variables and directories
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.
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 completed the pre-requisite tasks.
Running collector using YAML file
Go to the machine where you have setup docker to run the collector.
Place the YAML file generated from the Collector wizard to the correct directory.
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=/app/log --mount type=bind,source=/dwcc-output/datasources.yaml,target=/dwcc-output/datasources.yaml \ -e DW_AUTH_TOKEN=${DW_AUTH_TOKEN} -e DW_POWER_BI_GOV_SECRET=${DW_POWER_BI_GOV_SECRET} \ datadotworld/dwcc:2.235 --config-file=/dwcc-output/config-power_bi_gov.yml
If you are running the collector using Jar files, be sure to edit the command as instructed on this page.
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. Similarly, the log files are uploaded to the specified dataset and can be found in the directory mounted to target=/app/log specified in the command.
If you decide in the future that you want to run the collector using an updated version, simply modify the collector version in the provided command. This will allow you to run the collector with the latest version.
Running collector without the YAML file
Go to the machine where you have setup docker to run the collector.
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=/app/log --mount type=bind,source=/dwcc-output/datasources.yaml,target=/dwcc-output/datasources.yaml \ datadotworld/dwcc:2.235 catalog-powerbigov --collector-metadata=config-id=757ab5ab-4052-4fec-b65e-66a36b8ec850 \ --agent=collector-test-org --api-token=${DW_AUTH_TOKEN} --upload=true \ --name="Power BI Gov Collection" --output=/dwcc-output --upload-location=ddw_power_bi \ --azure-tenantid=my_tenant_ID --azure-clientid=my_client_ID --azure-secret=${DW_POWER_BI_GOV_SECRET} \ --user-workspace-include=false --all-workspaces-and-apps=false \ --disable-expression-lineage=false --workspace-include=workspaceA \ --workspace-exclude=workspaceB --datasource-mapping-file=/dwcc-output/datasources.yaml \ --image-collection=false --disable-max-requests-wait=false
If you are running the collector using Jar files, be sure to edit the command as instructed on this page.
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. Similarly, the log files are uploaded to the specified dataset and can be found in the directory mounted to target=/app/log specified in the command.
If you decide in the future that you want to run the collector using an updated version, simply modify the collector version in the provided command. This will allow you to run the collector with the latest 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
Maintaining an up-to-date metadata catalog is crucial and can be achieved by employing Azure Pipelines, CircleCI, or any automation tool of your preference to execute the catalog collector regularly.
There are two primary strategies for setting up the collector run times:
Scheduled: You can configure the collector according to the anticipated frequency of metadata changes in your data source and the business need to access updated metadata. It's necessary to account for the completion time of the collector run (which depends on the size of the source) and the time required to load the collector's output into your catalog. This could be for instance daily or weekly. We recommend scheduling the collector run during off-peak times for optimal performance.
Event-triggered: If you have set up automations that refresh the data in a source technology, you can set up the collector to execute whenever the upstream jobs are completed successfully. For example, if you're using Airflow, Github actions, dbt, etc., you can configure the collector to automatically run and keep your catalog updated following modifications to your data sources.
Managing collector runs and configuration details
From the Metadata collectors summary page, view the collectors runs to ensure they are running successfully,
From the same Metadata collectors summary page you can view, edit, or delete the configuration details for the collectors.