Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
We have a .NET Core application that embeds reports to web pages using the "User Owns Data" model. We assigned an Office 365 group as "Viewer" of the Workspace, but users of that group are getting 401 Unauthorized error when calling the GetReportInGroupAsync method. I assume users should get the "Viewer" permission through the group. How can we solve this problem? Thank you!
Solved! Go to Solution.
Hi @bwang1 ,
According to the error message, it seems that the "group" making the API call may not have sufficient privileges to access the reports. Make sure that the "group" has been granted the appropriate permissions in Azure AD and Power BI. I found the following thread which has the similar problem as yours, hope it can help you solve the problem.
For Service Principal to work for any embedding, you need to enable Service Principal option in Power BI Admin portal and then, add it to the Power BI workspace.
Please check the following once:
- Check if service principal is enabled under Admin portal in Power BI service. Follow step 3 onwards
- If things don't work for you after following the above step, try embedding with the developer sample
Besides, based on your code it looks like you are using ADAL library for authentication. Microsoft recommends to use MSAL library for authentication with Azure AD entities.
Also, you can use certificate instead of app secret for service principal authentication. (Docs)
Best Regards
Hi @bwang1 ,
According to the error message, it seems that the "group" making the API call may not have sufficient privileges to access the reports. Make sure that the "group" has been granted the appropriate permissions in Azure AD and Power BI. I found the following thread which has the similar problem as yours, hope it can help you solve the problem.
For Service Principal to work for any embedding, you need to enable Service Principal option in Power BI Admin portal and then, add it to the Power BI workspace.
Please check the following once:
- Check if service principal is enabled under Admin portal in Power BI service. Follow step 3 onwards
- If things don't work for you after following the above step, try embedding with the developer sample
Besides, based on your code it looks like you are using ADAL library for authentication. Microsoft recommends to use MSAL library for authentication with Azure AD entities.
Also, you can use certificate instead of app secret for service principal authentication. (Docs)
Best Regards
User | Count |
---|---|
13 | |
5 | |
2 | |
1 | |
1 |
User | Count |
---|---|
24 | |
3 | |
3 | |
2 | |
2 |