Microsoft Power BI

Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use.

Version Information

Template Name

Extension Name

VersionStatus
Microsoft Power BIue-ms-powerbi1 (Current 1.0.0)Fixes and new Features are introduced.

Refer to Changelog for version history information.

Overview

Microsoft Power BI is a Business Intelligence Tool. Power BI users can connect to and combine data from multiple data sources through a secure interface, creating Power BI datasets. Additionally, users may combine and transform collections of tables into a data pipeline, creating Power BI dataflows. This integration provides the capability to perform refresh actions on Microsoft PowerBI Datasets and Dataflows.

A typical Use Case is when UAC is used as a Data Pipeline orchestrator, where the last step of a workflow could be the refresh of a Microsoft Dataset or Dataflow.

Key Features

FeatureDescription
Refresh Datasets or DataflowsRefresh Datasets or Dataflows on Power BI and monitor until the refresh completes with success or failure.

Requirements

This integration requires a Universal Agent and a Python runtime to execute the Universal Task.

Area

Details

Python VersionRequires Python 3.11. Tested with Agent bundled python distribution.
Universal Agent Compatibility
  • Compatible with Universal Agent for Windows x64 and version >= 7.6.0.0.

  • Compatible with Universal Agent for Linux and version >= 7.6.0.0.

Universal Controller CompatibilityUniversal Controller Version >= 7.6.0.0.
Network and ConnectivityNetwork Connectivity towards MS Power BI is required.
MS Power BI VersionsTested with Power BI version 2.130.754.0 with REST API version 5.10.0. It should be compatible on later versions as long as backwards compatibility is guaranteed on the API level.

Supported Actions

Action: Refresh Dataset/Dataflow

This action allows users to refresh a dataset or a dataflow on Power BI. The task author has to provide the required Domain and Authentication fields, as well as the Dataset/Dataflow Name to refresh. Additionally, it can be decided (through Wait For Completion field) whether the task will simply initiate the refresh process, or also wait for a final success or failure state to be reached. In that case, a polling interval and maximum number of polls may be defined.

Configuration examples

Scenario A:
Connect to Power BI Services using Domain, Username & Password Authentication and Client ID. Afterwards, refresh selected Dataflow from given list and start polling every 10 seconds for the refresh’s status for 10 poll cycles.


Scenario B:

Connect to Power BI Services using Domain and Client Credentials Authentication. Afterwards, refresh selected Dataset from given list and start polling every 10 seconds until refresh is completed.

Action Output

Output Type

Description

Examples

EXTENSION

The extension output provides the following information:

  • exit_code, status_description: General info regarding the task execution. For more information users can refer to the exit code table.

  • invocation.fields: The task configuration used for this task execution.

  • result.dataset_refresh_info: The latest Dataset refresh information provided by the Power BI API. Only available when action is Refresh Dataset.

  • result.dataflow_refresh_info: The latest Dataflow refresh information provided by the Power BI API. Only available when action is Refresh Dataflow.

Successful Dataflow Refresh
 {
    "exit_code": 0,
    "status_description": "Refresh executed successfully",
    "invocation": {
        "extension": "ue-ms-powerbi",
        "version": "1.0.0",
        "fields": { ... }
    },
    "result": {
        "dataset_refresh_info": [
            {
                "requestId": "4047116e-983f-45c2-b85d-f7981ef0d921",
                "id": 55042190,
                "refreshType": "ViaApi",
                "startTime": "2024-07-30T14:45:05.277Z",
                "endTime": "2024-07-30T14:45:07.12Z",
                "status": "Completed",
                "refreshAttempts": [
                    {
                        "attemptId": 1,
                        "startTime": "2024-07-30T14:45:05.3538777Z",
                        "endTime": "2024-07-30T14:45:06.9476825Z",
                        "type": "Data"
                    },
                    {
                        "attemptId": 1,
                        "startTime": "2024-07-30T14:45:06.9476825Z",
                        "endTime": "2024-07-30T14:45:07.0883145Z",
                        "type": "Query"
                    }
                ]
            }
        ]
    }
}
Failed Dataflow Refresh
{
    "exit_code": 1,
    "status_description": "Execution Failed: Maximum number of daily refreshes reached.",
    "invocation": {
        "extension": "ue-ms-powerbi",
        "version": "1.0.0",
        "fields": { ... }
        }
    },
    "result": {
        "errors": [
            "Execution Failed: Maximum number of daily refreshes reached."
        ]
    }
}

Input Fields

NameTypeDescriptionVersion Information
ActionChoice

The action performed upon the task execution.

  • Refresh Dataset

  • Refresh Dataflow

Introduced in 1.0.0.

Domain or Tenant ID

Text

Unique Microsoft domain or identifier to be used when communicating with the foreign API.

Introduced in 1.0.0.

Authentication TypeChoice

The authentication type to be used when communicating with the foreign API. The following options are available.

  • Client Application - Using Username & Password.

  • Client Application - Using Client Secret.

Introduced in 1.0.0.

Client CredentialsCredentials

Credentials for "Using Client Secret" Authentication Type. The Credentials definition should be as follows.

  • Client ID as "Runtime User".

  • Client Secret as "Runtime Password".

Introduced in 1.0.0.

Username & Password CredentialsCredentials

Credentials for "Using Username & Password" Authentication Type. The Credentials definition should be as follows.

  • Username as "Runtime User".

  • Password as "Runtime Password".

Introduced in 1.0.0.

Client IDText

The ID returned upon the creation of the Client Application.

Only available if Authentication Type is set to “Using Username & Password”.

Introduced in 1.0.0.

Group - WorkflowDynamic Choice

The Microsoft Power BI Workspace Name. “My Workspace” is only applicable for Datasets and when Authentication Type is “Client Application - Using Username & Password”.

Introduced in 1.0.0.

DatasetDynamic Choice

The name of the Power BI Dataset to refresh.
Only available if Action is “Refresh Dataset”.

Introduced in 1.0.0.

DataflowDynamic Choice

The name of the Power BI Dataflow to refresh.
Only available if Action is “Refresh Dataflow”.

Introduced in 1.0.0.

Wait for Completion

Checkbox

If selected, the UAC Task Instance will run until the triggered refresh is completed with success or failure. Else Task Instance will finish immediately after refresh is triggered successfully.

Introduced in 1.0.0.

Polling Interval (sec)Integer

The polling interval in seconds while checking the Dataflow/Dataset Refresh Status.

Available if Wait for Completion is “true”.

As a best practice, if the Refresh expected completion duration is long, set the polling Interval to a larger value. A short value will trigger frequent checks towards Power BI which in the case of long-duration refreshes is inefficient in terms of resources.

Introduced in 1.0.0.

Max Number of PollsInteger

Maximum number of polls. If left empty polling runs indefinitely. Can be used to control the approximate expected duration of Dataset/Dataflow Refresh (in relation also to Polling Interval (sec)).

Available if Wait for Completion is “true”.

If the Maximum Number of Polls is reached the exit code of the task will be 40.

Introduced in 1.0.0.

Output Fields

The following output-only fields provide better visibility during the execution of Universal Task Instances.

FieldTypeDescriptionVersion Information

Refresh Status

String

Current status of ongoing refresh.

Introduced in 1.0.0


Cancelation and Rerun

  • In case of cancellation, extension stops polling for refresh status. The refresh process does not get cancelled if it has already been initiated.

  • In case of rerun the extension executes all commands from the beginning. That means that the extension will try to start the refresh even if the same dataset is currently being refreshed. In case a new refresh request is sent while the old one is still ongoing an appropriate error message will be raised.

Exit Codes

Exit Code

Status

Status Description

 Meaning

0Success

“SUCCESS: Task executed successfully.“

Successful Execution

1

Failure

“Execution Failed: <<Error Description>>”

Generic Error. Raised when not falling into the other Error Codes.

2

Failure

“Authentication Error: Account cannot be authenticated.“

Bad credentials

3

Failure

“Authorization Error: Account is not authorized to perform the requested action.“

Insufficient permissions

20Failure“Data Validation Error: <<Error Description>> “Input fields validation error.

21

Failure

“Refresh Running Error: Refresh already initiated “

Another refresh instance is already running for specific dataset/dataflow.

40

Failure

“Polling Timeout: Maximum number of polls is reached.“

The refresh has not been completed after max number of polls.


STDOUT and STDERR

STDOUT of this integration is empty and STDERR provides additional information to the user, the detail of it is tuned by Log Level Task Definition field.

Backward compatibility is not guaranteed for the content of STDOUT/STDERR and can be changed in future versions without notice.

How To

Import Universal Template

To use the Universal Template, you first must perform the following steps.

  1. This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.

  2. To import the Universal Template into your Controller, follow these instructions.

  3. When the files have been imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list.

Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to Integration Modifications.

Configure Universal Task

For a new Universal Task, create a new task, and enter the required input fields.

Integration Modifications 

Modifications applied by users or customers, before or after import, might affect the supportability of this integration. The following modifications are discouraged to retain the support level as applied for this integration.

  • Python code modifications should not be done.

  • Template Modifications

    • General Section

      • "Name", "Extension", "Variable Prefix", and "Icon" should not be changed.

    • Universal Template Details Section

      • "Template Type", "Agent Type", "Send Extension Variables", and "Always Cancel on Force Finish" should not be changed.

    • Result Processing Defaults Section

      • Success and Failure Exit codes should not be changed.

      • Success and Failure Output processing should not be changed.

    • Fields Restriction Section 

                     The setup of the template does not impose any restrictions. However, concerning the "Exit Code Processing Fields" section.

                      i. Success/Failure exit codes need to be respected.

                      ii. In principle, as STDERR and STDOUT outputs can change in follow-up releases of this integration, they should not be considered as a reliable source for determining the success or failure of a task.

Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.

Document References

This document references the following documents:

Document LinkDescription
Universal Templates

User documentation for creating, working with and understanding Universal Templates and Integrations.

Universal TasksUser documentation for creating Universal Tasks in the Universal Controller user interface.

Changelog 

ue-ms-powerbi-1.0.0 (2024-08-14)

Initial release supporting execution and monitoring of Dataset and Dataflow refreshes on MS Power BI.