Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a console app that uses the REST API to get a dataset (and later add rows to it). This works when I supply my own user/password credentials.
Now I have registered the app as a Web/API app in order to use an app key/secret instead. I can get a token, but when I make the same REST call I get 401 Unauthorized.
I have given the app the following Application permissions in Power BI Service (is this needed?):
Read and write all content in tenant
View all content in tenant
These permissions have been granted by an Azure Administrator.
In addition to the Delegated permissions that worked with user authentication:
Read and write all Datasets
View all Datasets
I have decode the two tokens.
The token for app key autentication contains this:
"roles": [
"Tenant.ReadWrite.All",
"Tenant.Read.All"
],
while the token for user based authentication contains this:
"scp": "Dataset.ReadWrite.All Workspace.ReadWrite.All",
What am I missing..?
Solved! Go to Solution.
Hi @tripleacoder,
As far as I know, the permissions of Power BI are all based on the users. So an App can't act as a user. Please refer to developer/power-bi-permissions where all the descriptions have "user".
Regarding "Tenant.ReadWrite.All", the documentation above also has a description. Actually, these permissions only can retrieve the profiles rather than data. Please refer to admin/reports_getreportsasadmin.
One simple proof we can see is that even an admin can't access all the App workspaces. The data is the precious asset of a company. I think this is reasonable.
Best Regards,
Dale
Most organization have app registrations locked down pretty tight. I am not familiar with that tool for app registration, but I don't imagine it is meant to be a workaround for corporate security restrictions, and I would expect it to fail for most users within most Azure tenants.
HI
I am getting a same error Failed to load resource: the server responded with a status of 401 when I try to open dashboard URL in new tab https://app.powerbi.com/dashboardEmbed?dashboardId=100114d8-9c7c-4ae1-b1d5-291603b4f22c&config=eyJjb...
It works fine on localhost sample dashboard app (C# visual studio 2017)
I am also getting this error on console for https://api.powerbi.com/powerbi/metadata/refreshusermetadata
When i open this link it shows message. See the screenshot below :
The dashboard URL should also work on a new tab too because I want to use this link into another website
Please help me, I am trying to find a solution for this now for two days.
Thanks in advance.
User | Count |
---|---|
16 | |
11 | |
5 | |
4 | |
3 |