Sunday, January 21, 2024
0 comments

PowerBI Embedded Report Integration with Web Application in ASP.NET Core using Azure Service Principal Method(Part-1)

1:52 PM

 


Assalamulaikum!

To get benefits of report sharing with multiple ERP users from single power premium user of PowerBI service we can consume PowerBI Embedded Report integration.

In Power BI Embedded, Microsoft offers two main solutions: 

1. Embed for your Customers, also known as App Owns Data
2. Embed for your Organization, also known as User Owns Data 

Embed For Your Customers/ App Owns Data 
Allows users to view your reports and dashboards without needing Power BI credentials or a license. This option is mostly used when you share reports with external users. Your app uses a service principal or a master user to authenticate with the Power BI Service.  


Embed For Your Organization/ User Owns Data 
Allows you to build an app that needs the user to have a Power BI license and credentials, effectively extending the Power BI service to them. This option is most suitable for internal users.

Power BI Embedded requires Premium capacity which may best be suited for larger organizations.  However, for development, you only need a Pro account. You require premium capacity only when your app is ready for production. Fortunately, Power BI allows trial pro accounts. Therefore, in this blog, we will discuss how we can implement a sample Power BI Embedded app for your customers using service principal.  

The pre-requisites for the implementation include: 

1. Active Power BI Pro license (on trial will suffice) 
2. Microsoft Azure subscription 
3. Code Editor (Visual Studio,VS Code, PyCharm, etc.) 

Additionally, you also need to have certain access privileges to be able to implement Power BI Embedded. This includes: 

1. Admin rights in Power BI Service /Microsoft Fabrics
2. Power BI workspace admin rights 
3. Azure AD Global Admin rights 
4. Allowing Service Principal to user Power BI APIs 


Today I will discuss step by step tutorial in 1st Part:

1. PowerBI Workspace Configuration:
    a. Allowing Service Principal To User Power BI APIs from admin panel of PowerBI
    

Once you login to your Power BI Service, the first step is to allow the service principal to use Power BI APIs.


2. Azure Tenant Configuration:
    a. Setting Up Service Principal 

    We need to configure Service Principal using  these steps:

    1. Login to https://portal.azure.com/. 
    2. Search for Azure Active Directory, and then select it.  
    3. In the Manage section in the pane on the left-hand side, click “App Registrations,” then click “New registration.” 

A new window will open. enter the name of the Service Principal in it, select the Multitenant option, and then click “Register” as shown below:


Once this is completed, you need to set up API permissions. In the Service Principal window that will open after the successful registration, click “API permission,” then click “Add a permission,” and lastly, select “Power BI Service.

In the window that opens, select “Application Permissions.” select both the tenants available and click ‘Add Permission.”


Once this is done, you need to click on the “Grant Admin Consent” and confirm.  

b. Client Secret Configuration:

Next, set up Client Secret. You can achieve this by clicking on “Client & Secrets” and then select “New Client Secret.” In the window that opens, provide the expiry, and click “Add.” 


Once this is done, you will see the details of the Client Secret. .  Copy the “Value” as you will need it later. This will be your “Client Secret.” which will be required to authenticate via access token during integration.



c. Service Principal, Client ID, And Tenant ID Extraction:

Next, click on the “Overview” in the pane on the left-hand side. This will take you to another page. From here, copy the Display name (which is your service principal), Application (client) ID, and Directory (Tenant) ID.  


In sha Allah, Next Article I will write about PowerBI Workspace,Report,Dataset Configuration as well as Source Code for rest API integration .





0 comments:

 
Toggle Footer