1

I have to upload a pbix using rest api but I am unable to do so. I am getting 401 error when I am trying to publish the reports whereas I am able to download the pbix files. (Tried in browser itself)

https://learn.microsoft.com/en-us/rest/api/power-bi/imports/postimport

I tried in the browser and using postman but received the same error.

I have given all the permissions to the app then too I am getting Error 401.

strong text

What do I need to change/modify?

enter image description here

1 Answer 1

1

You have given all of the Power BI API permissions but it doesn't look like you clicked the button below where you delegate the permissions. Below where you delegate the permissions make sure you click "Grant admin consent for ...."

Once you finish that you should see green check marks under the status column saying that permission has been granted for your tenant like in my screenshot.

I have attached a screenshot that shows the button to click and the green checkmarks. I cut of my tentant name in the status column but left the checkmarks so you can see what they look like.

API Permissions for APP Registration

Sign up to request clarification or add additional context in comments.

5 Comments

Hi I managed to get the right tick by clicking on grant admin consent but still I am facing the same issue (getting 401 error). As I am new so can you please guide me on this?
@VinayDandwani are you sure the account you are trying to use has a PowerBI Pro license?
Yes I am using Pro License @vvv4d
Can you post your code for how you generate the authorization bearer.
I am using it in browser only learn.microsoft.com/en-us/rest/api/power-bi/imports/postimport I am able to download the pbix and also I am able to refresh the dataset but I am not able to download the pbix. When i try it gives me 401 error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.