Scheduling automatic Power BI refresh from Fluid OAuth 2.0
his article explains how to keep a published Power BI report automatically up to date with Fluid data, using scheduled refresh in the Power BI service with OAuth 2.0 (Microsoft Entra ID).
Scheduled refresh runs with no one present, but it is not an "application" login. The Power BI service stores the OAuth 2.0 credentials of a real user – the person who set the data-source credentials – and replays them automatically (using Microsoft's Power BI Data Refresh client). To Fluid, every refresh therefore looks like that user, so:
the account must be an active Fluid user with permission to the data being refreshed, and
the stored credential must be re-consented (signed in again) if it expires.
Because the refresh runs as whoever set the credentials, use a dedicated account (for example
powerbi-refresh@yourcompany.com) rather than a personal one. If you use your own account and later leave or change your password, the refresh stops. See Step 1.
This is the only "unattended" option for Power BI against Fluid. If you need a true no-user / application identity, that's a different mechanism – see Programmatic access to the Fluid API using OAuth 2.0.
How it works
When you first build the report in Power BI Desktop you sign in to Fluid with your Organizational account, exactly like an interactive connection. When you publish to the Power BI service and turn on scheduled refresh, the service needs to sign in to Fluid on its own, on a timer. It does this by storing a refresh token for the account you used when setting the data-source credentials, and using it to obtain a fresh access token for Fluid each time it refreshes.
You (once) → sign in with the refresh account → Power BI stores a refresh token
Power BI service → (on schedule) uses the refresh token to get a Fluid access token
Power BI service → calls Fluid as that user → loads the latest dataLike an interactive Power BI connection, refresh requests a token for your Fluid site's host (for example https://yourcompany.fluid.work) — it does not use a custom api:// resource. The sign-in for refresh uses Microsoft's built-in Power BI Data Refresh application (client ID b52893c8-bc2e-47fc-918b-77022b299bbc), which Fluid has pre-authorised on the Fluid API app registration.
Before you begin
This guide assumes the one-time setup for Fluid + Entra is already done. In particular:
OAuth 2.0 is enabled on your Fluid site, and your site's host (for example
https://yourcompany.fluid.work) is registered with the Fluid API application so Microsoft issues tokens for it. (Both are Fluid-side configurations — ask your Fluid Account Manager.)An Entra administrator has granted admin consent to the Fluid API in your tenant.
The Power BI Data Refresh client (
b52893c8-bc2e-47fc-918b-77022b299bbc) is pre-authorised on the Fluid API app registration (a Fluid-side configuration), which is what allows scheduled refresh to sign in.
If any of that is missing, complete Excel and Power BI using OAuth 2.0 first (Part 1).
You will also need:
Role | Used for |
|---|---|
A Power BI author with a Power BI Pro/PPU licence (or Fabric capacity) | Building and publishing the report |
A dedicated refresh account (an Entra user, licensed for Power BI) | Storing the data-source credentials |
A Fluid System Administrator | Ensuring the refresh account exists as an active Fluid user with the right permissions |
Step 1. Choose a dedicated refresh account
Ask your Microsoft 365 administrator to provide (or create) a dedicated Entra user account for refresh, for example
powerbi-refresh@yourcompany.com, licensed for Power BI.Ask your Fluid administrator to ensure that same account exists as an active Fluid user (its Fluid username must match the account's work email / UPN) with permission to the data the report uses.
Don't use a personal account for production refresh. Refresh runs as that account, so if the person leaves, changes their password, or has the account locked, the schedule breaks. A dedicated account avoids this.
The refresh account signs in interactively once when you set credentials (Step 3). If your organisation enforces multi-factor authentication (MFA) or Conditional Access, ask your Entra administrator how the refresh account should be handled so its stored token can be renewed without an interactive prompt — otherwise refresh will eventually fail. See Keeping refresh running below.
Step 2. Build and publish the report
In Power BI Desktop, on the Home tab select Get Data > Web (or OData feed) and enter your Fluid data URL, for example
https://yourcompany.fluid.work/api/....When prompted, choose Organizational account > Sign in, and sign in with the dedicated refresh account from Step 1. Select Connect.
Shape the data as needed in the Power Query Editor, then Close & Apply and build your report.
Select Publish (Home tab) and publish to the workspace where the report will live.
Signing in as the refresh account while authoring keeps the connection consistent end-to-end. If you authored as yourself, that's fine — you'll switch to the refresh account when you set the credentials in Step 3.
Step 3. Set the dataset's data-source credentials to OAuth2
This is the step that stores the credential the service will reuse for refresh.
In the Power BI service, open the workspace containing your report.
Find the semantic model (dataset), select the ⋮ (More options) > Settings.
Expand Data source credentials and select Edit credentials.
Set Authentication method to OAuth2.
Set the privacy level as required by your organisation (for example, Organizational).
Select Sign in, and sign in with the dedicated refresh account.
This step gives the Power BI service permission to call Fluid on a schedule as the refresh account. The sign-in uses the Power BI Data Refresh client (
b52893c8-…); if it wasn't pre-authorised on the Fluid API app, sign-in fails withAADSTS650057(see Troubleshooting).
If Fluid isn't reachable from the internet
If your Fluid environment is only reachable inside your network (not a public address), the Power BI service can't reach it directly. In that case install an On-premises data gateway and bind the data source to it under Gateway and cloud connections, still using OAuth2 credentials. If your Fluid is cloud-hosted at a public address such as https://yourcompany.fluid.work, no gateway is needed.
Step 4. Configure the refresh schedule
On the same dataset Settings page, expand Refresh (or Scheduled refresh).
Turn Keep your data up to date On.
Choose the refresh frequency and times that suit your reporting needs.
(Recommended) Enter an email address under send refresh failure notifications so you're alerted if a refresh fails.
Select Apply.
To confirm it works, select Refresh now (⋮ > Refresh now) and check the Refresh history for a success entry.
Keeping refresh running
Stored credentials don't last forever. Refresh keeps working only while the refresh account's refresh token stays valid. It can be invalidated by:
the account's password being changed or reset,
the account being disabled or its licence removed,
MFA / Conditional Access policies that require a fresh interactive sign-in,
long periods of inactivity (refresh tokens expire after a period of disuse).
When that happens, refresh fails with a credentials/expired-token error. To fix it, repeat Step 3 — select Edit credentials and Sign in again.
To minimise interruptions: use a dedicated account with a non-expiring or long-lived, managed password, keep it licensed, and work with your Entra administrator on a Conditional Access approach that lets the refresh token renew without interactive MFA. Also keep the Fluid side healthy — the account must remain an active Fluid user with the right permissions.
Troubleshooting
What you see | Likely cause and fix |
|---|---|
| Your Fluid site's host isn't registered with the Fluid API application (or admin consent is missing). This is a Fluid-side configuration — contact your Fluid Account Manager. |
| The Power BI Data Refresh client ID ( |
"Need admin approval" when signing in | The tenant requires admin approval the first time. Ask your Entra administrator to approve access. |
Refresh fails with a credentials / token-expired error | The stored credential is no longer valid (password change, MFA, inactivity). Open dataset Settings > Data source credentials > Edit credentials and Sign in again. |
Refresh keeps failing right after MFA is enforced | Conditional Access is blocking the non-interactive refresh. Work with your Entra administrator on how the refresh account should be handled. |
| The refresh account isn't an active Fluid user, or its Fluid username doesn't match its work email. Ask your Fluid administrator to confirm the account. |
Refresh succeeds but returns no data, or | The refresh account is recognised but lacks Fluid permission to that data. Adjust the account's Fluid roles. |
"Unable to connect" / data source unreachable | The Power BI service can't reach Fluid. If Fluid is internal-only, configure an On-premises data gateway (see Step 3). |
Need help?
For the Fluid side (the refresh account as an active Fluid user, permissions, the data URL), contact your Fluid System Administrator or Fluid Account Manager.
For the Microsoft side (the dedicated account, licensing, MFA/Conditional Access, the data gateway), contact your Microsoft 365 / Azure administrator.
