PowerBI Embedding – AppOwnsData

There are two main scenarios for embedding Power BI content:

Watch this: https://www.youtube.com/watch?v=5OF0s2t0N3w

https://app.powerbi.com/embedsetup

AppOwnsData

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:
https://cloudarchitected.com/2019/03/embedding-power-bi-content-with-a-service-principal/

The script in above article can be downloaded from here:

https://trello-attachments.s3.amazonaws.com/5dd74caa1ac8d95449e57295/5dd74e74f2ae0822de6c12f4/a7d389968401e2c7328e2f6d20caf4d0/InitAppOwnsData.ps1

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”

image
3. Verify Service Principal (application name) in Group Members

image-1
4. Verify AzureADGroup and Service Principal are having Admin permission in Power BI workspace

image-2

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)

image-4
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

image-5

4. Run npm install if needed

5. npm run start to try the embed in single page application

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 )

Google photo

You are commenting using your Google 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