Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
675 views
in Technique[技术] by (71.8m points)

winforms - Is it possible to embed power bi into desktop application?

I'm an ISV developing a desktop application and would like to consider using power bi embedded for my application, but just can't seem to find information if it is possible to use inside desktop application. Searching on SO / Googe did not give me answer to this question.

power bi embedded homepage also did not stress out that it's restricted to web only.

P.S. If it is for "web apps only" - maybe using a WebBrowser control inside a form might be a workaround?

Does anyone has experience using power bi inside a desktop application? Or some information whether it is possible at all?

EDIT

power bi manual about integrating report into an app

?Step 1: Register a web app with Azure AD.

?Step 2: Get a Power BI report

?Step 3: Load a Power BI report into an IFrame

info from power bi developer forum A Power BI team member states that It is possible. Anything that can host and iframe can embed a Power BI report.

Updated question

Does anyone have experience doing this actually? How about "registering" winforms application with Azure AD which is a 1st step of integration process?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

EDIT: PowerBI Workspace Collections are now retired so this method no longer works.

Finally I've managed to do that.

Here are the main steps (in case if anyone else needs to embed Power bi report into WinForms solution):

1) you need Azure subscription that has an organizational account that has assigned power bi subscription (free version is enough) - if you don't have this, you can not assign power bi service access rights

2) in azure subscription you have to create PowerBI workspace collection (here you can get access keys and workspace collection id that will be necessary to access your power bi report)

3) design your report in Power BI desktop (if it's against Azure SQL db, then you can use Direct mode even with power bi free subscription)

4) to upload your report into azure power bi workspace collection you can use ProvisionSample project from this git hub repository

  • have to register this app in your AAD and add it power bi service related permissions
  • you have to create workspace (after that you can get it's id in Azure portal)
  • then upload pbix file in to workspace
  • if you use Azure SQL, then you have to update connection string (also possible using this solution)
  • in the EmpedSample project of this solution, you can see how it's working in case if it's embedded in Web solution
  • here is a link to power bi idea that requests easing this process (just in case if anyone's interested in this, too...)

5) now, to get this into winforms solution, you can use this WinformsSample project (it's not merged into master at the moment, don't know how to easily download it, but tested it and it works!)

  • interesting that this app does not require registering in azure - seems like workspace collection key + related data is sufficient...

P.S. This 5th point somehow makes me a bit nervous (i.e. storing app keys in the client side code) perhaps it would be possible to move app keys to REST API side and retrieve it using REST service call - then, I guess it would be more secure... + changing app keys (there is a re-generation tool in Azure portal - see workspace collection entry) would not involve changes to client application


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...