There are two main scenarios for embedding Power BI content:
- Embedding for your organization’s users (who have Power BI licenses) (https://app.powerbi.com/embedsetup/UserOwnsData).
- Embedding for your users and customers without requiring Power BI licenses (https://app.powerbi.com/embedsetup/AppOwnsData). This type of embedding is also known as Power BI Embedded.
Watch this: https://www.youtube.com/watch?v=5OF0s2t0N3w
If you need to see how it works in single page web application, please scroll down to the end of this article.
Read this article first:
The script in above article can be downloaded from here:
1. Update the parameters, then execute the script.
2. Ensure step 4 in that article: new AzureADGroup should be in “Developer settings” -> “Allow service principals to use Power BI APIs”
3. Verify Service Principal (application name) in Group Members
4. Verify AzureADGroup and Service Principal are having Admin permission in Power BI workspace
For testing an embedded app: Clone the Power BI Developer Sample at https://github.com/Microsoft/PowerBI-Developer-Samples. Open the App Owns Data solution in Visual Studio. Edit the following sections of the Web.config file. Include your Application ID (for your service principal), workspace ID and report ID.
5. Go to the solution in Visual Studio, ensure $key in step 2 is using as “applicationSecret” in web.config (we can also use the key generated in App Registration -> Certificates & secrets)
6. Optional: Go to Azure portal, grant permission in Enterprise Application and App Registered if needed
Single Page Web application for Power BI Embed
1. Clone the source at: https://github.com/CriticalPathTraining/PowerBiEmbedded
2. Go to “Demos\PowerBiDaySPA” and open it using Visual Studio Code
3. Open “AppSettings.ts” and modify value
4. Run npm install if needed
5. npm run start to try the embed in single page application