Forum Discussion

jjrscorpio's avatar
jjrscorpio
Frequent Visitor
6 years ago

Update Parameters in Group with Power Automate using Power BI REST API

Hi All,

 

I want to use Power Automate and the Power BI REST API to update a dataset parameter in a workspace, as there is not an easy way to manually update the parameter in the UI. The flow is not so complex, see picture below:

 

 

Up until now I have managed to have this flow working but only if I sent my own username and password hardcoded in the HTTP request, but this is not desired.

 

I've registered an app in Azure ADD to avoid using my credentials. I do get an access token but then the update part doesn't work, no matter what I try.

 

I get the following errors:

 

1 - "NotFound. ItemNotFound. Dataset XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX is not found". I get this error if the security group is not a member of the dataset. 

Pragma no-cache
Transfer-Encoding chunked
Strict-Transport-Security max-age=31536000; includeSubDomains
X-Frame-Options deny
X-Content-Type-Options nosniff
RequestId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Access-Control-Expose-Headers RequestId
request-redirected true
Cache-Control no-store, must-revalidate, no-cache
Date Mon, 09 Mar 2020 17:19:29 GMT
Content-Type application/json; charset=utf-8
Content-Length 104

 

Or 

 

2- "Forbidden. InvalidRequest. This operation is only supported for the dataset owner". I get this error regardthles of the security group being the owner or not

 

Steps followed:
1- Granted the registered app, Read and Write permissions to Power BI
2- Enable "Allow service principals to use Power BI APIs" in the admin portal. I'm using a security group and added the service principal as member of the group.
 
I think i'm doing something wrong but don't exactly what after almos 3 full days of failed tries.
 
Any help will be welcomed.
 
Thanks 
 
Jimmy Jimenez

 

3 Replies