问题
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.
回答1:
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 ofAuthenticationContext
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 beAAD
. This token has many privileges, so for security reasons you may want to useEmbed
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.
来源:https://stackoverflow.com/questions/58430715/ways-to-share-dashboards-and-reports-for-users-without-a-powerbi-account-and-not