Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

0

Unable to refresh dataflows via Microsoft Flow

Hello everybody,

 

I've been trying to refresh a dataflow via a Microsoft Flow custom connector, but although I gave all the authorizations needed for APIs to read and write inside all my workspaces/reports/dashboards/etc. I get an error saying:

 
Operation failed (401), see response below
Status:
Unauthorized (401)
Headers:
{
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"date": "Fri, 11 Jan 2019 09:50:16 GMT",
"requestid": "bf0f1148-7e1c-482a-8657-f0a630c3ebb9",
"x-frame-options": "deny",
"content-type": "application/octet-stream",
"cache-control": "no-store, must-revalidate, no-cache",
"transfer-encoding": "chunked"
}
 
The same procedure works great for refreshing datasets and it is the one shown in this guide (in a few words: registration of the app via the App registration tool, creation of the custom connector on Flow, replication of the URL on Azure and then testing with the "POST" method on the custom connector as shown on the official documentation Power BI REST dataflow reference).
In the dataflow case, I've only changed the URL from https://api.powerbi.com/v1.0/myorg/datasets/{DatasetID}/refreshes to https://api.powerbi.com/v1.0/myorg/groups/{groupId}/dataflows/{dataflowId}/refreshes.
Is there a solution for this issue? And, in case, how can I fix it?

Thank you,
Flavio
 
Status: Delivered
Comments
v-qiuyu-msft
Community Support

Hi @Anonymous,

 

I tested follow the article: https://docs.microsoft.com/en-us/power-bi/service-dataflows-developer-resources. The refresh dataflow API works fine: 

 

q5.PNG

 

In your scenario, the issue could be that the access token is expired. Please renew the access token then test it again. 

 

Best Regards,
Qiuyun Yu 

Anonymous
Not applicable

Thank you very much for your reply @v-qiuyu-msft.

Going deeper, I think the issue resides in the absence of the "Dataflow.ReadWrite.All" required scope, which I cannot find either in Azure or the App Registration tool. Is there a way to add it (maybe through code if not available in other ways)?

Anonymous
Not applicable

A quick update:

Now that I found the scope permission (it was Datapool.ReadWrite.All so there might be a mistake in the PBI API REST reference...) the connector works well and when I test it the dataflow is correctly refreshed.

The issue now is that when I put it in a flow (the trigger is "a file is modified or created in a SharePoint folder" and it works fine) my connector won't work and it says:

 

BadRequest

Status code: 400

Body:

{
"error": {
"code": "BadRequest",
"message": "Bad Request",
"details": [
{
"message": "'refreshRequest' is a required parameter",
"target": "refreshRequest"
}
]
}
}
v-qiuyu-msft
Community Support

Hi @Anonymous,

 

For your issue, I would suggest you create a support ticket to get dedicated support. 

 

Support Ticket.gif

 

Best Regards,
Qiuyun Yu 

v-qiuyu-msft
Community Support
Status changed to: Delivered
 
Anonymous
Not applicable

The solution happens to be here, so the issue is now resolved.

Thank you very much anyways @v-qiuyu-msft!