5

I am developing the Embedded Power BI in my application.When I am accessing the reports from my power BI Account. I am unable to get the exception as

REST API Azure Error: 'Microsoft.Rest.HttpOperationException' Operation returned an invalid status code 'Un Authorized'.

I have gave view permissions to my app in Azure portal. I thought there is no wrong with my code. I thought it's related to permissions of my app in Azure portal. I have missed some where else. Please guide me.

for adding permission I have followed below link
https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-register-app/

Here is an update:
I have created new project in https://dev.powerbi.com/apps and choose view dashboard and reports then i am able to get the dashboard and reports but If i add permission to the existing project in https://portal.azure.com/ .I am getting the exception.I don't ,why i am getting exception as Unauthorised with my existing account. Can any one please help me out from this problem.
Thanks in advance.

Itz.Irshad
  • 1,014
  • 5
  • 23
  • 44
prasanthi
  • 562
  • 1
  • 9
  • 25

1 Answers1

0

I ran into the same or a similar problem when setting up an application that did PowerBI embedding. In my scenario I use direct connections in reports I embed. Those reports rely on a PowerBI Data Gateway to get the data. The embedded master account or service principal account needs to be added as an Admnistrator on the PowerBI Data Gateway.

  1. Go to PowerBI.com
  2. Click the gear in the top right corner
  3. Click Manage Gateways
  4. Click on your Data Gateway, it will default to the "Gateway Cluster Settings" tab. Click the Administrators tab and add your embedded master account or service principal as an administrator. Now when you try to view the embedded report the : 'Microsoft.Rest.HttpOperationException' Operation returned an invalid status code 'Un Authorized' will be resolved and you will see the embedded report.
vvvv4d
  • 3,881
  • 1
  • 14
  • 18