DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How to Configure an HTTPS Endpoint for Mule Applications With One-Way SSL
  • Keep Your Application Secrets Secret
  • Dynatrace Perform: Day Two
  • Mule 4 Custom Policy Example

Trending

  • What’s Got Me Interested in OpenTelemetry—And Pursuing Certification
  • Monoliths, REST, and Spring Boot Sidecars: A Real Modernization Playbook
  • Enhancing Business Decision-Making Through Advanced Data Visualization Techniques
  • Distributed Consensus: Paxos vs. Raft and Modern Implementations
  1. DZone
  2. Data Engineering
  3. Data
  4. Power BI Embedded Analytics — Part 3: Power BI Embedded Demo

Power BI Embedded Analytics — Part 3: Power BI Embedded Demo

This article is part of a four-part series. This final installment presents a Power BI Embedded Demo application with solutions, integration steps, and key features.

By 
Robin Rizvi user avatar
Robin Rizvi
DZone Core CORE ·
May. 22, 25 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
2.0K Views

Join the DZone community and get the full member experience.

Join For Free

Note: This article presents the details of a Power BI Embedded Demo application. This is a continuation of the articles Power BI Embedded Analytics — Part 1 and Power BI Embedded Analytics — Part 2, which discuss Power BI Authoring and Power BI Embedded. So, it is recommended that you go through the previous parts of the series.

Power BI Embedded Demo

Source Code

Github: https://github.com/robinrizvi/embedded-analytics-poc

This repository contains the proof of concept for demonstrating embedded analytics use cases through Power BI. This repository contains:

  • Power BI artefacts (source files): PBIX files (files that contain report and dataset information), data source Excel files, etc. These can be found in the Power BI folder.
  • POC documentation: Documentation that details the findings for this POC.
  • POC application modules: Application modules mirroring the technology stack that contain code to demonstrate aspects of this POC.

POC Application

The sample application is included in the repository mentioned above. It demonstrates embedded analytics usage in an application which can be used as a reference when integrating with your own application.

Modules

  • poc-web: This is the frontend of the application developed with Angular using Power BI client APIs.
  • poc: This is the backend of the application developed primarily with Java, Spring Framework, MSAL, and Power BI admin REST APIs.

Configuration Points

  • poc-web: src/app/common/service/powerbi/powerbi.service.ts
  • poc: com/powerbi/poc/config/Config.java

Code Organization

  • poc-web poc-web
  • poc poc

Steps to Execute

  • poc-web: Install Node and NPM npm install -g @angular/cling serve.
  • poc: mvn clean install -DskipTests. Run the main class: PocApplication.

Power BI Setup (Trial for POC)

The following setup uses a personal email, such as Gmail, Hotmail, etc. Work/organization accounts need to be managed on an organizational level from the Microsoft 365 admin portal.

Authoring

  • Microsoft Account Setup
    • Navigate to https://www.microsoft.com/en-in/microsoft-365/enterprise/office365-plans-and-pricing.
    • Choose any subscription that allows a trial (try for free) option.
    • Follow the wizard and press Setup Account.
    • Once you reach the payment, you can skip it and close the window — no need to complete the process; we just need to complete the account setup.
  • Activating Power BI Service (Web)
    • Navigate to https://powerbi.microsoft.com/en-in/getting-started-with-power-bi/.
    • Click on Try Free.
    • Log in using the created onmicrosoft email ID.
    • Once the Power BI portal is ready (it will be activated with a Power BI free license)
    • Click on the user icon and select "Start Trial" to activate the trial of the Power BI Pro license.
  • Power BI Desktop
    • Download Power BI Desktop from https://www.microsoft.com/en-us/download/details.aspx?id=58494
    • Log in to Power BI Desktop using the onmicrosoft email ID created above.
    • Connect to the datasource(s) and create a dataset.
    • Save as a PBIX file.
    • Click Publish to publish to Power BI Service.
    • Resume authoring reports/dashboards against the created dataset in the Power BI Service (Web).

Embedding

  • Embedding the setup tool
    • Navigate to https://app.powerbi.com/embedsetup/AppOwnsData
    • Follow the wizard and grant all Power BI privileges and suggested Azure permissions:
      • Log in with the created onmicrosoft email ID
      • Register the app in Azure AD and grant all privileges for Power BI admin REST APIs and Azure permissions.
  • Adding a client secret (required for authentication) for the created Azure AD app through the above wizard
    • Go to the Azure portal with the newly created onmicrosoft.com email.
    • Search for and select Azure Active Directory.
    • Select App registrations and select your application from the list.
    • Select Certificates & secrets.
    • Select Client secrets, and then select New Client secret.
    • Provide a description of the secret and a duration.
    • Select Add.
  • Creating an Azure AD security group 
    • Your service principal doesn't have access to any of your Power BI content and APIs. Create a security group in Azure AD to give the service principal access. Then add the service principal you created to that security group.
      • Assign a security principal/app to the security group.
  • Enabling the Power BI service admin settings (Power BI -> Admin Portal)
    • Enable Embed content in apps, either for the entire organization or for the specific security group that was created in Azure AD.
    • Enable Allow service principals to use Power BI APIs either for the entire organization or for the specific security group that was created in Azure AD.
  • Adding the service principal to your workspace (Power BI Service -> Workspace settings)
    • Under Access, add the service principal or the security group that was created.
  • Getting the required properties to construct an embed configuration that can be used by client APIs to embed the Power BI artifact in the application
    • Once a report has been created, open the report in Power BI Service.
    • Get the workspace ID from the URL. An example URL is https://app.powerbi.com/groups/eed5dcae-8289-4804-9b36-71e172508f1c/reports/1526aed8-b15f-405c-a42a-c2fcc21c3581/ReportSection. The URL part parameter after groups is the workspace ID, i.e., eed5dcae-8289-4804-9b36-71e172508f1c, and the URL part parameter after the reports is the report ID, i.e., 1526aed8-b15f-405c-a42a-c2fcc21c3581
    • User Power BI Admin rest API through the application or from the Power BI URL: https://learn.microsoft.com/en-us/rest/api/power-bi/reports, where APIs can be tried out directly from this page by passing the correct parameters.
    • Use client APIs through the application or Power BI playground (developer sandbox, embed your report) to test APIs and get the IDs and names of artefacts in a report.

Embedding Examples

  • Embedding report
  • Embedding visual
  • Embedding dashboard
  • Embedding dashboard tile
  • Embedding ad-hoc report (with runtime application data) with programmatic visual and data configuration
  • Embedding ad-hoc report designer
  • Embedding Q&A visual
  • Inbound context passing (passing context/data from an application to Power BI)
  • Outbound context passing (passing context/data from Power BI to the application)
  • Drill up and down
  • Drill through (Power BI to Power BI)
  • Drill through (Power BI to application)
  • Report authoring through the report designer
  • Report authoring programatically
  • Application session validation (interactivity within the application and Power BI artifacts after application session invalidation)
  • Power BI session validation (interactivity within Power BI artifacts after Power BI session invalidation)
  • Multi-tenancy (through RLS or Row Level Security)
  • Embedding a MongoDB-backed report (using the Atlas SQL interface and connector)
  • Embedding REST API backed report (using Web connector)

Embedding Analytics POC

Conclusion

This three-part series explored the full spectrum of Power BI authoring and embedding, from the fundamentals of Power BI services, data federation, and authoring to integrating real-time, interactive reports within custom applications. In this final part, we walked through a hands-on Power BI Embedded demo application, detailing the setup, configuration, and implementation steps across both front-end and back-end components.

The goal of this series has been to demystify the Power BI ecosystem for developers and architects who are looking to embed rich analytical experiences into their applications. Whether you’re building dashboards for internal teams or delivering data-driven insights to end users in a multi-tenant SaaS product, Power BI Embedded offers a powerful and flexible solution.

With the provided demo repository and configuration guide, you now have a working reference to experiment, extend, and integrate Power BI into your applications.

Happy embedding and see you in another tech deep dive soon!

Analytics HTTPS application

Opinions expressed by DZone contributors are their own.

Related

  • How to Configure an HTTPS Endpoint for Mule Applications With One-Way SSL
  • Keep Your Application Secrets Secret
  • Dynatrace Perform: Day Two
  • Mule 4 Custom Policy Example

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

OSZAR »