1

I try to get the list of the datasets for a particular tenant, using: https://api.powerbi.com/v1.0/myorg/datasets

I get then a 403 error, it seems that my access code is not suitable for this call.

I could get an access_code successfully but I assume that it has the wrong scope since the response states: "scope": "openid profile email User.Read"

yet I granted the correct permissions in azure:

enter image description here

when trying to add in the scope in the authentication call: openid offline_access DataSet.ReadWrite.All then I get an invalid_grant error

Allen Wu
  • 15,529
  • 1
  • 9
  • 20
laloune
  • 548
  • 1
  • 9
  • 26
  • 1
    Try `openid profile email https://analysis.windows.net/powerbi/api/.default` as the `scope`. – Allen Wu Sep 21 '20 at 07:47
  • works perfectly! If I get it right ```the https://analysis.windows.net/powerbi/api/.default``` uses all the permissions granted, right ? Would you please mind answer to the question so that I can mark it as solved – laloune Sep 21 '20 at 08:49
  • Added the answer :) – Allen Wu Sep 21 '20 at 09:10

1 Answers1

3

Try openid profile email https://analysis.windows.net/powerbi/api/.default as the scope.

You can find this endpoint while adding the power bi permission from Azure Portal:

enter image description here

Allen Wu
  • 15,529
  • 1
  • 9
  • 20