How to Integrate PowerBI Report in Asp.net Website?

In this article will look how we can share the Organization PowerBI Report or DashBoard with their customer, Customer who don’t have and account, get the access to PowerBI. Customer doesn’t require to login in order to view the PowerBI Report.

PowerBI Apis offer capabilities to access the some of the feature like Dashboard, Report, Dataset etc.

Pre-Requisite

  • At least one Power BI Pro account is needed to create an embedded application. The Power BI Pro account acts as a master account for your application.
  • Create an Azure Active Directory tenant to use with Power BI
  • Azure App Registrations.
  • New Service User.
  • The master account permission is needed in Azure AD.

Register with Azure Portal

  • Sign into the Azure portal.
  • Go-To Portal Setting in Right-Hand Corner and choose your Subscriptions.
  • In the left-hand navigation pane, choose All Services, search App Registrations as shown below.PowerBI1
  • Click on New App Registrations and choose application Type as “WebApp/ API” and provide the sign-on Url as http://localhost:13526

Knowing your Client ID

  • Once you register your applications you will get the below screen.PowerBI2
  • The Applications ID listed as a GUID. This is the client ID of the Applications.

Applying Permission to the Applications.

  • Click on Settings of the Applications and clicked on Required PermissionsPowerBI3
  • Select window Azure Active Directory and then make sure Access the directory as the signed-in user is selected. Select Save. It will delegate the permission to your apps
  • PowerBi4
  • Delegate the Permission to the Power BI Service App, Depending upon your requirement.
  • PowerBi4
  • At the end click on “Grant permission”. The Grant Permissions action is needed for the master account to avoid being prompted for consent by Azure AD.

Implementing the code

  • Download the sample code from the GitHub Link.
  • After download Zip File, you will see this 2 Project.PowerBI5
  • Go-To User Owns Data
  • Choose a Project “Integrate-Report-Web-App”.
  • In web.config, you will be required to add the below information’s
    • PowerBI8

Issue Faced

I was getting the below error, Later I found it to be proxy issue where the URL was blocked on the computer.

PowerBi6I just added the proxy setting in my web.config as mentioned below.

PowerBI7

Advertisement

One thought on “How to Integrate PowerBI Report in Asp.net Website?

  1. Thanks for providing code it is really helpful.
    Can we pass logged in user detail when we get powerbi report? Because in my project, powerbi report returns report based on user role.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.