In our case, a service principal account doesn't h...
# integrate-powerbi-datahub
d
In our case, a service principal account doesn't has privileges inside workspace to query dashboard. We want to use only admin API to scan and retrieve pbi assets
l
@gentle-hamburger-31302 ^
g
The dataset’s underline table information is only retrievable using Admin API as per PowerBi API documentation. We do need to add service principle as admin in workspace to retrieve that information
cc: @elegant-doctor-86344 , @loud-island-88694
d
Based on my internal tests, we can retrieve all the information using the
getInfo
endpoint without admin in workspace. We need to set the parameters the get all information: lineage=true datasourceDetails=true datasetSchema=true datasetExpressions=true getArtifactUsers=true https://docs.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-post-workspace-info
g
What would be good time to take call on Monday? We are using same API
Hi @damp-queen-61493 If you go to the above-mentioned link, in the permission section they have mentioned administrative permission. If you go to Power BI Admin Portal -> Tenant Settings, they have mentioned about Service Principle need permission to call Admin API Please find the screenshot of the tenant setting message. As we are using the same API as you mentioned above, Could you please configure the same client id and client secret that you have used in your test in the powerbi source recipe and run the ingestion, the ingestion should work. FYI… We need to first call the POST getInfo API, thereafter we need to check the status of the screen-result job to complete and thereafter call Get scanResult to get the actual dataset detail. cc: @elegant-doctor-86344, @loud-island-88694
d
Hi @gentle-hamburger-31302 I've allready configure the service principal with correct permissions and tested with postman and python, everything works fine. But the API used inside function
get_dashboards
is not the Admin endpoint , instead, is the Get Dashboard endpoint that requires scopes
Dashboard.ReadWrite.All or Dashboard.Read.All
. If only use admin endpoint, that required scopes are
Tenant.Read.All or Tenant.ReadWrite.All
, and so, we don't need to include service principal in every workspace. The scan result already has information about the dashboards, I don't undestand why the get_dashboard functions tries to reach the api again. (Sorry for my english, it's not my mother language)
g
@damp-queen-61493 Got your point. If you compare the response of both API calls, the workspace-info API call returns WorkspaceInfoDashboard instance which has lesser attributes as compare to Dashboard instance. for example webUrl is missing in WorkspaceInfoDashboard and we wanted the functionality where user can jump to PowerBi Dashboard from DataHub UI. cc: @loud-island-88694
cc: @elegant-doctor-86344
d
@gentle-hamburger-31302. Tks for your response. After added the service principal as a viewer in the workspace, it worked. But unfortunately, we don't use dashboards on PBI, only reports. So, in this case we can't use this plugins unless it ingest the reports even without dashboards. And it would be nice if we can choose to only use Admin endpoints, so we don't need to add service principal with extra permissions on users workspaces.
g
Noted… will check the feasibility to cover your requirement