0
votes

When I'm trying to assign a user to a workspace programmatically using the api method AddGroupUserWithHttpMessagesAsync, facing the issue Operation returned an invalid status code 'Unauthorized'. I have given all the API permissions as shown in the below image. Please suggest.

enter image description here

1
When authenticating with service principal API permissions are irrelevant. The rights for the service principal for the workspace are not properly set. - Andrey Nikolov

1 Answers

0
votes

First, only basically granting permissions to Azure AD App is not enough. You need to enable Service Principal option in Power BI Admin portal, and then add it to the Power BI workspace.

Please follow this document to embed Power BI content using service principal with app secret, or with a certificate.