The purpose of this article is to embed analytics, reports, and visualizations that different users may require in an organization to 3rd party applications or software as a service SAAS and platform as a service PAAS application.
Embedding in Power BI enables ISVs and developers to integrate Power BI content (reports, dashboards, and tiles) directly into an application.
You just acquire and pay for the dedicated capacity required to serve the content and each individual consumer doesn’t require a license. There only needs to be a single “master” Power BI Pro account.
The power BI embedded offering is targeted at ISVs and developers (i.e. building apps for external users).
Phase 1 - Register an app to Power BI embed content
Head over to dev.powerbi.com/apps
Step 1 – Logon to Power BI pro account
This also needs to have access to the Azure id tenant.
Step 2 — Fill in the app details
Register an application for Power BI in Azure
For app type, generally, a native app is selected as it has more options.
The current URL is taken from documentation; however, this is the URL that it is going to redirect once we successfully authenticate.
Step 3 — Choosing what type of access to APIs we would need
APIs to access
Step 4 — When you click on register
It will return a client ID
If you have chosen a web app, the system will generate a client ID and client secret.
Step 5 — Permission Configuration
There is a couple of permissions that we need to configure. To do that, we head over to the Azure portal.
Permission Configuration in Azure
To click on permissions, we click on settings.
Azure Power BI Embedded Settings
Click on Required permissions in the API access menu and in Windows Azure Active Directory, click on Access the directory as the signed-in user.
Permission in Azure for Embedded Analytics
Click Save and hit Grant Permissions at the top of the list.
And for Power BI Service, uncheck 2 options;
- Read and write access to all content in the tenant.
View all content in the tenant.
Azure Power BI Embedded Permission Settings
Then click Save and Grant Permissions.
Phase 2 — Azure Environment Setup for Analytics
This is Power BI embedded dedicated capacity resource.
Step 1 create a resource group.
When the user clicks on the resource, the system takes them to the resource details view within the Azure tenant.
From there, we click on Add to add the Power BI embedded resource.
Power BI Embedded
Data points for creating Power BI Embedded.
Power BI Embedded Pricing Tier
This is the administrator that would be linking the app workspace.
The resource would be available in a minute or 2.
If you pause, you won’t be billed.
If you want to add Power BI Master and Pro to others, you can do so.
Power BI Capacity
Step 2 — Head over to Power BI service and create an App workspace
Now we need to create an app workspace in Power BI service, put up some content in there and link up that resource in azure to the app workspace.
Power BI Service App Workspace
The diamond icon indicates that it is premium now.
Power BI Service App Workspace
Step 3 — Add Content to App Workspace
You can do so by using add data set the option in the app workspace.
Azure Sales And Marketing
That’s it!! The sample content is ready for embedding in a web app outside of powerbI.com.
Phase 3 — Get an Embed Token Power BI API
The architecture of Embedding Power BI Report with Azure Functions
Step 1 Log in to Azure Portal and create a function app
Function App Azure Portal
Give it a valid name, valid subscription and select other necessary details.
Microsoft Azure Function
Step 2 — Select the function
Select the function list and click the plus sign and select the HTTP trigger function and the language that you are looking to use.
Azure App Function Template
Name the function and select create.
There is already some sample code there that would obviously be running.
We would need this to be set up for Power BI embedded.
- CLIENT_ID; Value: Azure AD > App Name > Application ID
- GROUP_ID; Value: <Power BI Group ID> (https://powerbi.com/groups/<Group ID>/reports/<Report ID>/ReportSection) we simply need to hardcode this into application.
- REPORT_ID; Value: <Power BI Report ID>
- USERNAME; Value: Your Power BI Pro Account Username
- PASSWORD; Value: Your Power BI Pro Account Password
Now click to app settings,
Azure Function App
Step 3 — Add the variables that we just created
Azure Function Apps
Then click Save.
Now go back to function, and create new file, filename.json.
Now get the function URL that you just got and paste it into the index.html file as the value in the variable getEmbedToken.
Save and open the index.html file in the browser.
Power BI Embedded with Azure Demo
That’s It. I hope now you know more about text analytics in Microsoft Azure and Power BI ?. May you know someone who would find this article informative, please share!, follow me on Twitter or visit my website and stay tuned.