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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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