Forum Discussion

hajar_bkg's avatar
hajar_bkg
New Member
1 year ago
Solved

Expression.Error: "The 'Authorization' header is only supported during anonymous connection

Hello Power BI / Fabric / Power Query Community, I'm working on a Dataflow Gen2 in Microsoft Fabric to connect to a REST API that requires dynamic Bearer token authentication. I'm hitting a wall wit...
  • v-sgandrathi's avatar
    1 year ago

    Hi hajar_bkg,

    Thank you for the detailed explanation and context. You're on the right track, but you've encountered a known limitation in Fabric Dataflow Gen2.

    Dynamic Authorization headers, even with anonymous connection mode, are currently not supported in Dataflows Gen2 due to platform-level security restrictions. This is why your approach using #"Authorization" = GetToken() is causing the Expression.Error.

    The recommended solution is to shift token-based logic to a proxy service (such as an Azure Function or Power Automate flow) that manages authentication and returns clean JSON data. Your Dataflow can then connect to that service anonymously and securely.

    This limitation is acknowledged by Microsoft, and improvements may be forthcoming. For now, using a proxy service is the most reliable and scalable workaround.
    Solved: Re: API in dataflowgen2 - Microsoft Fabric Community

    I hope this helped! Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.

     

    Thank you,
    Sahasra
    Communtiy Support Team.