Reputation: 106
I am attempting to embed a PowerBI report into my web app. I have followed both Microsoft documentation and online tutorials (specifically https://www.kieferconsulting.com/2021/11/01/how-to-embed-power-bi-content-in-a-react-application/).
I am taking the approach of using a Service Principal rather than a Master User. I have created an Azure App and am using a Security Group to act as the Service Principal.
I've added the Service Principal to the PowerBI Workspace I want to use as an Admin user.
I ran into issues making the requests via my Node app and have been trying to use Postman to check the requests are valid.
I've been able to Authorize my app and get a valid token:
Using this token, I've also been able to get the embed URL:
But, when I try then get the Embed Token, using the same Auth Token in the previous step:
I get the following error:
401 Unauthorized
{
"error": {
"code": "PowerBINotAuthorizedException",
"pbi.error": {
"code": "PowerBINotAuthorizedException",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
}
}
Upvotes: 1
Views: 1646
Reputation: 106
As per the official documentation for embedding using a service principal:
My Workspace isn't supported when using service principal.
While the report I was trying to embed was not located in "My Workspace", its underlying dataset was located there.
Once I moved the dataset to a different workspace, I no longer received the Unauthorized errors I was previously seeing
Upvotes: 1