Power BI Embedded Walk Through Part 2 of 3

In my previous blog post, Power BI Embedded Walk Through Part 1 of 3 I have shown how to create a Power BI Embedded workspace collection in the Azure Portal as one of the first major steps. In this post, I will show how to get your Power BI report into the Azure Power BI Embedded workspace and get the embed details needed to set up the client side code in your web application.

To manage a workspace and upload a PBIX file, unfortunately, there isn’t a UI yet and must rely one the following options at the very least

I opted for the ProvisionSample app.
So, download the code from the github repository
Power BI Embedded Walk Through Part 2 of 3-1
Extract the zip and open the .sln file
Power BI Embedded Walk Through Part 2 of 3-2
Restore the nugget packages by right clicking on the solution. Otherwise, you will get build errors.
Power BI Embedded Walk Through Part 2 of 3-3Open the App.config file and fill out the app settings

<appSettings file="Cloud.config">
<!-- Your Azure subscription ID -->
<add key="subscriptionId" value="" />
<!-- The Azure resource group name -->
<add key="resourceGroup" value="" />
<!-- The Power BI Workspace Collection Name -->
<add key="workspaceCollectionName" value="" />
<!-- The Power BI Workspace Collection Access Key -->
<add key="accessKey" value="" />
<!-- The Power BI Workspace-->
<add key="workspaceId" value="" />
<!-- Credentials to connect to datasource within Power BI -->
<add key="username" value="" />
<add key="password" value="" />
</appSettings>

At initial start, you can get the subscription id, resource group, workspace collection name and access key from the Azure Portal.
Power BI Embedded Walk Through Part 2 of 3-4

Get one of the Access Keys
Power BI Embedded Walk Through Part 2 of 3-5

Update the app.config file with these values
Run the ProvisionSample project in Visual Studio
Console application loads.
Power BI Embedded Walk Through Part 2 of 3-6

We first need to create a workspace
Enter 1 to go to Collection Management
Enter 6 to Provision a new Workspace
Enter a name for the workspace
Copy the workspace Id and enter it into the app.config file. This is so that you don’t have to enter it again in the console each time you want to work in that workspace.
Power BI Embedded Walk Through Part 2 of 3-7
To import the PBIX file, enter 7 to Exit group
Enter 2 to go to Report management

Power BI Embedded Walk Through Part 2 of 3-8
Enter 3 to Import PBIX Desktop file
Press Enter to work with current workspace
Enter dataset name to skip for now
Enter the full path and file name

Power BI Embedded Walk Through Part 2 of 3-9

To get the embed details to embed the report into your app, enter 8 to generate embed details
Hit enter for default workspace collection and workspace id
For embed mode, I select 2 for Edit & Save Mode
Press enter for first report
Press enter of no row level security
Press enter to skip RLS for roles
Press Y to copy embed token to clipboard
Power BI Embedded Walk Through Part 2 of 3-10
Also, copy the Embed Url:
Embed Url: https://embedded.powerbi.com/appTokenReportEmbed?reportId=47e3e117-65b9-4bb4-8283-98525e5b7c59
In the Azure Portal, we can see workspace just created displayed
Power BI Embedded Walk Through Part 2 of 3-11

Next, we will look to how to embed this report into a web application Power BI Embedded Walk Through Part 3 of 3

 


Advertisements

2 thoughts on “Power BI Embedded Walk Through Part 2 of 3

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 )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s