Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello!
I have problem trying to execute dataset refresh using POSTMAN api calls (for test purpose).
Clients POWER BI admin provided me with client id, tenant id, group id, dataset id and client secret.
The tenant settings in the Admin portal are enabled.
Now my actions:
First I generate Bearer token, using https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow as example
Method: post
url: https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
headers: Content-Type: application/x-www-form-urlencoded
body:
client_id={clientId}
&client_secret={clientSecret}
&scope=https://analysis.windows.net/powerbi/api/.default
&grant_type=client_credentials
I get response 200 and token.
Then API call to refresh daset
Method: get
url: https://api.powerbi.com/v1.0/myorg/groups/{group_id}/datasets/{dataset-id}/refreshes
headers Authorization: Bearer {token}
But i get response 401 -
x-powerbi-error-info: | ServicePrincipalIsNotAllowedByTenantAdminSwitch |
I want to know if problem is from my side or something wasn’t done correctly while registering app in POWER BI or setuping in Azure.
If it is from my side were I did go wrong?
P.S. Client does not want to use login and password
Helllo @ArthurL
I have finally resolved my issue with postman calls, please have a look at resolution posted under below post.
Hi! 401 means the accounts doesn't have the authority to make the action. That sounds like you haven't added the service principal to the workspace you are reaching to execute the refresh. (Admin or member, not viewer)
You also need to validate that the PowerBi Admin Portal tenant settings have the Service Principal usage of API enabled.
I guess one of those two might be the problem,
I hope that helps,
Happy to help!
Hello!
Thank you for your answer.
Their admin added app to workspaces, but I still get the error 401
Hi @ArthurL ,
The documentation at Datasets - Refresh Dataset In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs It says that you need to use a POST request. In your original question, you say you use GET.
Further as suggested by @ibarrau check if the "Allow service principals to use Power BI APIs" setting is enabled and that the service principal is added to the correct security group
Kinds regards
Thank you for noticing that I used GET instead of POST.
But still error remains the same 401.
Next week I will have meeting with their BI admin and we will go step by step instruction to see what we missed.
I’ll update pos after that if managed to find something
Were you able to get resolution for this issue, I am having similar problem during generating EmbedToken, my post is below. For me somehow it is not able to reach the host and througing HTTP 400 Error
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
60 | |
32 | |
27 | |
22 | |
22 |
User | Count |
---|---|
63 | |
49 | |
28 | |
24 | |
19 |