Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Power BI embedded analytics allows you to embed Power BI content, such as reports, dashboards and tiles, into your application.
In this tutorial, you'll learn how to:
To use your application, your users will need to sign in to Power BI.
The embed for your organization solution is typically used by enterprises and large organizations, and is intended for internal users.
Important
If you are embedding content for a national/regional cloud, the first few steps of this tutorial are different. See Embed content for national/regional clouds for details.
This tutorial includes instructions for configuring an embed for your organization sample application in one of the following frameworks:
Note
The .NET Core and the .NET Framework samples allow the end user to view any Power BI dashboard, report or tile they have access to in the Power BI service. The React TypeScript sample lets you embed only one report that your end user already has access to in the Power BI service.
The code samples support the following browsers:
Before you start this tutorial, verify that you have both the following Power BI and code dependencies:
Power BI dependencies
Your own Microsoft Entra tenant.
One of the following licenses:
Note
To move to production you'll need one of the following configurations:
Code dependencies
.NET Core 3.1 SDK (or higher)
An integrated development environment (IDE). We recommend using one of the following IDEs:
To create an embed for your organization sample app, follow these steps:
Registering your application with Microsoft Entra ID allows you to establish an identity for your app.
To register your application with Microsoft Entra ID, follow the instructions in Register your application.
Microsoft Fabric keeps your reports, dashboards, and tiles in a workspace. To embed these items, you need to create them and upload them into a workspace.
Tip
If you already have a workspace, you can skip this step.
To create a workspace, do the following:
Your next step is to create a report and upload it to your workspace. You can create your own report using Power BI Desktop, and then publish it to your workspace. Or, you can upload a sample report to your workspace.
Tip
If you already have a workspace with a report, you can skip this step.
To download a sample report (not Direct Lake enabled) and publish it to your workspace, follow these steps:
Open the GitHub Power BI Desktop samples folder.
Select Code and then select Download zip.
Extract the downloaded ZIP and navigate to the Samples Reports folder.
Select a report to embed, and publish it to your workspace.
To embed your content, you'll need to obtain a few parameter values. The parameter values depend on the language of the sample application you want to use. The table below lists which parameter values are required for each sample.
Parameter | .NET Core | .NET Framework | React TypeScript |
---|---|---|---|
Client ID | ![]() |
![]() |
![]() |
Client secret | ![]() |
![]() |
![]() |
Workspace ID | ![]() |
![]() |
![]() |
Report ID | ![]() |
![]() |
![]() |
Tip
Applies to:
.NET Core
.NET Framework
React TypeScript
To get the client ID GUID (also know as application ID), follow these steps:
Log into Microsoft Azure.
Search for App registrations and select the App registrations link.
Select the Microsoft Entra app you're using for embedding your Power BI content.
From the Overview section, copy the Application (client) ID GUID.
Tip
Applies to:
.NET Core
.NET Framework
React TypeScript
To get the client secret, follow these steps:
Log into Microsoft Azure.
Search for App registrations and select the App registrations link.
Select the Microsoft Entra app you're using for embedding your Power BI content.
Under Manage, select Certificates & secrets.
Under Client secrets, select New client secret.
In the Add a client secret pop-up window, provide a description for your application secret, select when the application secret expires, and select Add.
From the Client secrets section, copy the string in the Value column of the newly created application secret. The client secret value is your client ID.
Note
Make sure you copy the client secret value when it first appears. After navigating away from this page, the client secret will be hidden and you'll not be able to retrieve its value.
Tip
Applies to:
.NET Core
.NET Framework
React TypeScript
To get the workspace ID GUID, follow these steps:
Sign in to Power BI service.
Open the report you want to embed.
Copy the GUID from the URL. The GUID is the number between /groups/ and /reports/.
Tip
Applies to:
.NET Core
.NET Framework
ReactTypeScript
To get the report ID GUID, follow these steps:
Sign in to Power BI service.
Open the report you want to embed.
Copy the GUID from the URL. The GUID is the number between /reports/ and /ReportSection.
The Power BI embedded sample application allows you to create an embed for your organization Power BI app.
Follow these steps to modify the embed for your organization sample application, to embed your Power BI report.
Open the Power BI developer samples folder.
Select Code and then select Download zip.
Extract the downloaded ZIP and navigate to the PowerBI-Developer-Samples-master folder.
Open one of the following folders depending on the language you want your application to use:
Note
The embed for your organization sample applications only support the previously listed frameworks. The Java, Node JS and Python sample applications, only support the embed for your customers solution.
Sign into the Azure portal.
Select App registrations. If you can't see this option, search for it.
Open the Microsoft Entra application you created in Step 1 - Register a Microsoft Entra application.
From the Manage menu, select Authentication.
In Platform configurations, open your Web platform and in the Redirect URIs section, add https://localhost:5000/signin-oidc
.
Note
If you don't have a Web platform, select Add a platform and in the Configure platforms window, choose Web.
Save your changes.
Open the Embed for your organization folder.
Open the embed for your organization sample app using one of these methods:
If you're using Visual Studio, open the UserOwnsData.sln file.
If you're using Visual Studio Code, open the UserOwnsData folder.
Open appsettings.json and fill in the following parameter values:
ClientId
- Use the client ID GUID
ClientSecret
- Use the client secret
Run the project by selecting the appropriate option:
If you're using Visual Studio, select IIS Express (play).
If you're using Visual Studio Code, select Run > Start Debugging.
Sign into the embedding sample application.
Note
During your first sign in, you'll be prompted to allow Microsoft Entra permissions for the app.
When the embedding sample application loads, select the Power BI content you want to embed and then select Embed.
After configuring and running the embed for your customers sample application, you can start developing your own application.
Users need permission to access the Power BI folder the report is in. When you grant a user permission to access a folder, the change usually takes effect only after the user logs in to the Power BI Portal. For the new permissions to take effect immediately, in the Embedded scenario, make an explicit call to the RefreshUser Permissions REST API at startup. This API call will refresh the permissions and avoid authorization failures for users with newly granted permissions.
Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn moreTraining
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
Certification
Microsoft Certified: Power BI Data Analyst Associate - Certifications
Demonstrate methods and best practices that align with business and technical requirements for modeling, visualizing, and analyzing data with Microsoft Power BI.