1
votes

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://docs.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

1 Answers

1
votes

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