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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
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

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.