📖Guide: PowerBI Embedding

Are you looking for the power-bi syntax?

The power-bi syntax documentation can be found here.

Version compatibility

  • power-bi was introduced in version 4.34 of the JourneyApps Container.

  • Support for Power BI dashboards was introduced in version 4.58.5 of the JourneyApps Container.

It is possible to embed Power BI reports and dashboards directly into apps. This allows complex dashboards and visualizations to be served from within an application.

Naturally, since this relies on an external service, there are a number of moving parts that make this possible. Every effort has been made to abstract away as much complexity as possible, but there are still a number of considerations to keep in mind:

  1. JourneyApps cannot guarantee 100% uptime of the Power BI service.

  2. There is an average latency of between 5 to 15 seconds before a report is loaded in a view.

  3. The runtime cannot control the elements within an embedded report.

  4. The data-model that resides on the device is not directly accessible from within the embedded report.

  5. The service is online-only and will not function in the absence of a stable internet connection.

  6. Interactions on the embedded report such as date pickers and slicers will trigger reloads from the Power BI service.

What is required

Assumptions

It is assumed that you are familiar with Power BI and have deployed a valid report to PowerBI.com. If this is not the case, please start here.

Dashboards can be used to display real-time streaming data. Please see the documentation here.

Start by creating a CloudCode task in OXIDE that uses the "PowerBI Auth" template.

Once the task is created, you will see the following:

index.js
const PowerBI = require("cc-powerbi");
const program = new PowerBI.PowerBIEmbeds({
    // Azure Active Directory TenantID
    tenant: 'TENANT_ID',

    //The Application ID that the registration portal (apps.dev.microsoft.com) assigned your app.
    client_id: 'YOUR_CLIENT_ID',

    //The application secret that you created in the app registration portal for your app.
    client_secret: 'YOUR_CLIENT_SECRET',

    // Dedicated user with read access the Power BI reports
    username: 'powerbi-dev@example.com',
    password: 'YOUR_PASSWORD'
})

export async function run(params) {
    return await program.run(params);
}

The PowerBIEmbeds.run function allows the params passed in from the runtime to be merged in with the initial configuration. The runtime will effectively send the reportID as well as a directive telling this task if it should also fetch the report URLs. If the runtime already has the report URLs, but needs a new token, this task will skip the call to fetch the URLs, effectively increasing the speed of the request.

Before these parameters are explained, have a look at the following chart.

FieldDescriptionWhere to find it

tenant

This is the ID of the Azure Active Directory Service

client_id

The ID of the Azure App integration that can access Power BI Rest requests

client_secret

The Secret token needed in conjunction with the client_id

(same as above)

username

The main Power BI Pro user account username that connects Azure and Power BI Embedded

password

The main Power BI Pro user account password that connects Azure and Power BI Embedded

Start using the component

See the power-bi component syntax.

You will need the name of this CloudCode task if you use the power-bi helper tools in the runtime, and you are also going to need the reportID which is found in the same way when you sign into PowerBI.com and have navigated to the report you wish to embed.

Last updated