Forum Discussion

vamshikrishna20's avatar
vamshikrishna20
Helper III
7 months ago
Solved

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 sa...
  • Zanqueta's avatar
    7 months ago

    Hi vamshikrishna20 ,

     

    At present, the refresh API for Gen2 Dataflows has some important limitations:

    Key Points:

    1. 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.
    2. 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 via
      https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
      using 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 🌀.

  • v-ssriganesh's avatar
    7 months ago

    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.