Forum Discussion
Refresh Gen2 Dataflow with Rest API
Hi,
Did anyone tried refresh gen2 dataflows using Power BI Rest API's. I am trying to refresh gen dataflow from ADF using Power BI Rest API's with spn authentication, but uinable to do and it says spnbasedauth not allowed.
if anyone has tried it earlier, please help
Hi vamshikrishna20 ,
At present, the refresh API for Gen2 Dataflows has some important limitations:Key Points:
- SPN (Service Principal) is not supported for Gen2 Dataflows
The error message “spnbasedauth not allowed” confirms this. For Gen2 Dataflows, only delegated user authentication is supported, not SPN.
This differs from datasets, where SPN is allowed. - Why this limitation exists
Gen2 Dataflows are part of the Fabric architecture, and the refresh API is not yet fully aligned with SPN-based authentication. Microsoft is working towards enabling enterprise scenarios, but for now, only OAuth2 with user credentials works.
Possible Alternatives:
- Option 1: Use a user account without MFA
Configure a technical account (with MFA disabled) and obtain an OAuth2 token viahttps://login.microsoftonline.com/{tenant}/oauth2/v2.0/tokenusing grant_type=password.
Then call the API: POST https://api.powerbi.com/v1.0/myorg/dataflows/{dataflowId}/refreshes
Reference:
Dataflows - Refresh Dataflow - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Option 2: Use Power Automate or Fabric Pipelines
Instead of ADF + API, you can use Fabric Data Pipelines or Power Automate to schedule refreshes. These methods already support delegated authentication without complications.If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.
Hi vamshikrishna20,
Thank you for posting your query in the Microsoft Fabric Community Forum.
Azure Data Factory does not support any authentication method that can successfully trigger a Gen2 Dataflow refresh.Gen2 Dataflows currently require delegated user authentication, which ADF cannot provide when calling the Power BI REST APIs. Because of this, ADF-based orchestration is not supported for Gen2 Dataflow refresh scenarios, regardless of the authentication approach.
If you need to orchestrate refreshes, the supported options are:
- Fabric Data Pipelines
- Power Automate
- Built-in scheduling within Fabric
If ADF orchestration is a strict requirement, you may need to redesign the solution so ADF loads data upstream (Lakehouse/Warehouse) and Gen2 Dataflows consume that data instead.
Thanks, Zanqueta for sharing valuable insights.
Best regards,
Ganesh Singamshetty.
5 Replies
- ZanquetaSuper User
Hi vamshikrishna20 ,
At present, the refresh API for Gen2 Dataflows has some important limitations:Key Points:
- SPN (Service Principal) is not supported for Gen2 Dataflows
The error message “spnbasedauth not allowed” confirms this. For Gen2 Dataflows, only delegated user authentication is supported, not SPN.
This differs from datasets, where SPN is allowed. - Why this limitation exists
Gen2 Dataflows are part of the Fabric architecture, and the refresh API is not yet fully aligned with SPN-based authentication. Microsoft is working towards enabling enterprise scenarios, but for now, only OAuth2 with user credentials works.
Possible Alternatives:
- Option 1: Use a user account without MFA
Configure a technical account (with MFA disabled) and obtain an OAuth2 token viahttps://login.microsoftonline.com/{tenant}/oauth2/v2.0/tokenusing grant_type=password.
Then call the API: POST https://api.powerbi.com/v1.0/myorg/dataflows/{dataflowId}/refreshes
Reference:
Dataflows - Refresh Dataflow - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Option 2: Use Power Automate or Fabric Pipelines
Instead of ADF + API, you can use Fabric Data Pipelines or Power Automate to schedule refreshes. These methods already support delegated authentication without complications.If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.
- vamshikrishna20Helper III
Hi Zanqueta - which authentication can support if i want to refresh gen2 dataflows using ADF
- v-ssriganeshCommunity Support
Hi vamshikrishna20,
Thank you for posting your query in the Microsoft Fabric Community Forum.
Azure Data Factory does not support any authentication method that can successfully trigger a Gen2 Dataflow refresh.Gen2 Dataflows currently require delegated user authentication, which ADF cannot provide when calling the Power BI REST APIs. Because of this, ADF-based orchestration is not supported for Gen2 Dataflow refresh scenarios, regardless of the authentication approach.
If you need to orchestrate refreshes, the supported options are:
- Fabric Data Pipelines
- Power Automate
- Built-in scheduling within Fabric
If ADF orchestration is a strict requirement, you may need to redesign the solution so ADF loads data upstream (Lakehouse/Warehouse) and Gen2 Dataflows consume that data instead.
Thanks, Zanqueta for sharing valuable insights.
Best regards,
Ganesh Singamshetty.- v-priyankataCommunity Support
Thank you for reaching out to the Microsoft Fabric Forum Community.
I hope the information provided was helpful. If you still have questions, please don't hesitate to reach out to the community.
- v-priyankataCommunity Support
Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.