Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I recently built a PowerBI model that creates my organization's Group/Dataset/Report and Users relationships using this code.
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/admin/",
[Headers=[Authorization="Bearer " & #"Get Access Token"()],
RelativePath= "groups?$top=200&$expand=datasets,dataflows,reports,dashboards,users"])),
Everything is working perfectly and refreshes daily. However, I added a new function to get the refresh times for any group and dataset. and so the trouble begins... the function works perfectly only when using a token from the BI API web admin test site. When I substitute the function #"get access token"() it complains about web credentials and fails.
I have edited my credentials for this source to look like my other web sources which all refresh and connect using the same token from the function and yet this web call using the same function fails on connection credentials?
So it appears that a token from the BI API TEST SITE works fine whereas a token from Azure based on permissions on the cloud APP has a problem with authorization for this particular web call?
Has anyone seen anything like this? are there additional permissions required on the Azure App for this call?
Basically this call doesn't work.
(Group as text, Dataset as text) =>
let
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/groups/" & Group & "/datasets/" & Dataset & "/refreshes",
[Headers=[Authorization="Bearer "& #"Get Access Token"()]])),
And This call does.
Source = Json.Document(Web.Contents("https://api.powerbi.com/v1.0/myorg/admin/",
[Headers=[Authorization="Bearer " & #"Get Access Token"()],
RelativePath= "groups?$top=200&$expand=datasets,dataflows,reports,dashboards,users"])),
Seems related to the Cloud permissions because the API test token works with Groups that have the account-user on the access list and fails for workspaces not accessible to the BI Admin Service Account which makes sense.
The cloud application is missing permission for the organization to workspaces.read.all and this must be the culprit when it hits groups that don't have the app user on the access list. I will ask for WS.read.all permission for this app and see if it fixes the issue.
@PhillipWeeks , for Token based auth, refer if this can help
Rest source - Token based
https://www.advaiya.com/generate-dynamic-token-and-get-data-from-custom-api-in-power-bi/
Hi and thanks for the try but I already get dynamic tokens, I have an azure app as well to enable admin function privileges and this part works perfectly for the initial web call to get workspaces, and expand the other columns and so all is good with the Get Access Token Function.
It is the call to the "get token function" from this particular web call that is the issue.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |