2

I want to share some PowerBi dashboards to users with no Microsoft/PowerBI account. I know that I can share it in a Sharepoint online but the problem with this solution is the share button (Facebook, Twitter, URL) that we can find at the button of the web page. I don't want users to be able to share the reports on their own. So is there a way to share the reports with free users without allowing them to share them back.

Thank you for your help.

Meteor2
  • 63
  • 1
  • 1
  • 7

2 Answers2

12

The only way to do this is to embed the report/dashboard in your application (e.g. a web application) and restrict the access using custom authentication. See the official docs Tutorial: Embed Power BI content into an application for your customers for more information.

First you need to know that there are two modes for embedding Power BI - user owns data and app owns data. With the first mode, when embedding, the user will authenticate itself using it's own Power BI Pro account, i.e. each of your users needs Power BI Pro license. With the later one, you need only one "master account", which will be used for authentication. In your case you need app owns data.

Basically you need to do the following:

  • Register an application - go to dev.powerbi.com/apps and register an application. Select which permissions to grant it (if you aren't sure, for your first tests simply grant them all). Copy the guid - this is the app ID, a.k.a. client ID.

  • Next step is to authenticate from your application and get an access token. Use Azure Active Directory Authentication Library (ADAL) for that - call some of the acquireToken methods of AuthenticationContext class.

  • Use this access token to call the Power BI REST API and get the embedUrl of the element you want to embed, e.g. report.

  • Use Power BI JavaScript client to actually embed this element. You need to initialize one embed configuration class and pass information about element type (report, dashboard, tile), where to find it (embedUrl), authentication (access token), some other configuration options (show or hide filters pane, navigation, etc.), filters to be applied and so on. In case you will use the access token acquired above, set tokenType to be AAD. This token has many privileges, so for security reasons you may want to use Embed token instead. In this case use the access token to call the REST API again (e.g. Reports GenerateTokenInGroup).

  • Call powerbi.embed method of the JavaScript client pass the embedded configuration to visualize this Power BI element in your app.

Andrey Nikolov
  • 12,967
  • 3
  • 20
  • 32
  • Thank you for your answer, even tho I didn't understand everything ( I'm not really that good at PowerBI), is there a video on youtube or a tutorial that explains your idea? – Meteor2 Oct 17 '19 at 12:56
  • This require programming skills. For basic understanding check Guy in a Cube videos, e.g. [this](https://www.youtube.com/watch?v=0y2oJikC6Xc) one. – Andrey Nikolov Oct 17 '19 at 13:00
  • Hey Andrey, can you also filter the report for certain users? Let's say you have one report with many user data, but the data should only display the user data logged in in our web application. – Rick Grimes Dec 02 '22 at 08:31
  • 1
    @RickGrimes Yes, of course! There are 2 ways to do that - to use the normal filters (which is not secure, and the user can remove the filter from the report) or to use RLS. Using [filters](https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/control-report-filters) is [straight forward](https://stackoverflow.com/questions/57284193/how-to-set-filters-in-reports-power-bi-embedded-javascript/57304001#57304001) and for RLS you must pass so called [effective identity](https://stackoverflow.com/questions/62065627/how-to-pass-filtering-parameters-in-powebi-c-sharp-sdk/62079686#62079686). – Andrey Nikolov Dec 02 '22 at 09:04
  • @AndreyNikolov thank you for you fast answer. Sounds great I will give it a try with effective identity. – Rick Grimes Dec 02 '22 at 09:54
  • Hi. The links in the second last point (to actually embed the report) are for Power BI wiki in Github, which are deprecated. If you don't mind, could you please provide the updated link? – Himanshu Mar 02 '23 at 08:59
  • 1
    @Himanshu The wiki is deprecated, but the [JavaScript client](https://github.com/microsoft/PowerBI-JavaScript) is still there and there is a [link to the new location of the documentation](https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/) where you can find how to [configure the settings](https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/configure-report-settings) too. – Andrey Nikolov Mar 02 '23 at 13:38
0

The easiest option is downloading and deploying a secure sharing app via Azure Marketplace or Appsource. The Binokula Instant app portal is recommended, which allows you to securely share with approved users who do not have a Power BI licence; either via Microsoft AppSource or Azure Marketplace.

Aaron
  • 1