Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
nagaraj
Post Patron
Post Patron

Operation returned an invalid status code 'Unauthorized''

Hello,

 

 Need help on the below error, I am trying to embed the Power BI report in Dot Net application. 

 Issue is raised at the below highlighted line in the code, not sure what is the issue. Please help

 

Error.jpg

 

Error:    Operation returned an invalid status code 'Unauthorized''

 

Regards
Nagaraj

1 ACCEPTED SOLUTION

Hi @nagaraj ,

Accoring to offical document, the account must be the admin of the related workspaces when you need to embeded report in the application. You can check the details in this documentation.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
v-yiruan-msft
Community Support
Community Support

Hi @nagaraj ,

This error message seems to be caused by insufficient permissions or incorrect authentication.Please check the solution in the following threads, hope they can help you.

Unauthorized error 401 for power reports embedding

Authentication fail when embedded application

Embed content within your application

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft 

 

 Have already given access to all API's to the registered app.

 

Not sure any specific requests i need to provide at workspace level.

 

Permissions.jpg

 

Regards
Nagaraj

Hi @nagaraj ,

Accoring to offical document, the account must be the admin of the related workspaces when you need to embeded report in the application. You can check the details in this documentation.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft

 

 Thanks for the inputs.

 

 Service Principle we are using is already an ADMIN in the premium Workspace.

 And myself is also an ADMIN on this workspace.

 

 I have downloaded Power BI Dotnet sample (App Owns Data), using that solution i can see my report is getting embed successfully. But when i try the same from other solution i am getting the error. (FYI ... For the client credential i am using the application id and application secret of the APP that i registered. If i pass Service Principle ID and Secret then it is saying unauthorized on this tenant).

 

Looks like some settings need to be performed on the Workspace or may be on the application i registered.

 

Regards

Nagaraj

Hi @nagaraj ,

Hope the following documentations can help you:

https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-troubleshoot#authentication

https://docs.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft 

 

 Thanks for the help, there was some issue with Service Principle.

 

 Resolved it and the issue got resolved. Thanks

 

REgards

Nagaraj

Hi @nagaraj ,

Thanks for your feedback. Could you please share your solution if it is convenient? Then the other members in the community also can solve their issue based on your solution if they face the similar issue with you. And could you please mark this thread as Answered since the issue has been resolved? Thanks a lot.

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiruan-msft

 

 Since i have was using a new Service principle which was not having the access to TENANT's the issue was there.

 Now i have all the privileges and resolved the issue.

 

Regards

Nagaraj

I meet the same issue, could you detail your solution again, thanks

I am facing the same issue and can you help me on how you figured out that the service principal is not having access on the tenant.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.