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.
The app has been given the following delegated permissions:
Read and write all Datasets
View all Datasets
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, still using the same permissions.
So I have tried giving the app the following Application permissions in Power BI Service, because the docs say these apply to a daemon app:
Read and write all content in tenant
View all content in tenant
These permissions have been granted by an Azure Administrator.
As part of debugging, I have decoded 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",
I have also looked into assigning the app/service principal a Contributor role, but I am unsure on which level (Subscription/Resource group/Resource).
What am I missing..?