Forum Discussion
Error getting embed token with row level security
Things that finally worked for us:
1) Had to give the service principal the permission "ReadOverrideEffectiveIdentity" by running Microsoft's rest api call with the datasourceId and the gatewayid.
see this link for more info:
The identifier used in the JSON BODY Request is not the Azure AD service principal object Id, turns out that there is a separate identifier for the service principal when it is added to powerBi workspace as an admin.
running a rest call to get users on the workspace/report would give the actual identifier.
*This is wierd as the documentation doesnot say that, but have raised this concern with microsoft.
2) After this, a normal call to get embed token along with effective identity works fine.
After doing what worked for you (find the service principal identifier using the rest api and give the ReadOverrideEffectiveIdentity permissions to it), now we´re getting a different error: "Only folder user with reshare permissions can generate embed token". Do you know what might be the cause of this?