Is it possible to embed power bi into desktop application?

半城伤御伤魂 提交于 2019-12-04 17:23:06
Prokurors

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!