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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Anonymous
Not applicable

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

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

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

Hi @Anonymous 

 

 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

Anonymous
Not applicable

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

Hi @Anonymous

 

 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

Anonymous
Not applicable

Hi @Anonymous 

 

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

 

 Resolved it and the issue got resolved. Thanks

 

REgards

Nagaraj

Anonymous
Not applicable

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

Hi @Anonymous

 

 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

Anonymous
Not applicable

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

dhwani
Microsoft Employee
Microsoft Employee

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors