Forum Discussion

v-sunitkumar's avatar
v-sunitkumar
Microsoft Employee
2 months ago
Solved

Assistance Required – Power BI Workspace Refresh Failing with AccessDenied Error

Hi Team, We are encountering an AccessDenied error when trying to refresh the Power BI report in the Power BI Service (workspace/online). However, when we refresh the same report locally using Powe...
  • Parchitect's avatar
    Parchitect
    2 months ago

    Hi ,

    Thanks for additional input. As noted before that re-auth temporarily fixes it points to a session/token-lifecycle issue, not a static permission change. With OAuth2 (organizational account) the stored token is user-bound — and if the interval between re-auths is well under 90 days, that's usually a Conditional Access sign-in-frequency / session policy rather than the 90-day inactivity expiry. Worth checking with your Entra admin first.

    The durable fix is to drop the user token. Since the ADX connection also offers Workspace Identity and Service Principal, either removes the expiring session:

    • Cloud connection → Workspace Identity (nothing to rotate; not supported for gateway connections).
    • Via gateway → Service Principal (rotate the secret / store it in Key Vault).

    Then grant the identity viewer on the cluster and bind the model to the new connection:

     

    Best regards,
    Parchitect · Solutions Architect · Microsoft Fabric Specialist

  • Bipin-Lala's avatar
    2 months ago

    Hi v-sunitkumar,

     

    This intermittent AccessDenied error is likely an authentication token lifecycle conflict that happens when an organizational account (user login) is used to authenticate a backend cloud dataset instead of an infrastructure identity.

    The reason it refreshes fine in Desktop and temporarily works in the Service after you re-authenticate is due to token caching. Your personal OAuth2 token works fine initially, but when Power BI Service attempts a scheduled refresh hours later, the background token refresh handshake fails because of conditional access rules or a policy timeout.

     

    The Two Most Common Root Causes

     

    1. Entra ID Conditional Access & MFA Policies (Most Common)

    Your organization likely enforces a conditional access policy requiring Multi-Factor Authentication (MFA) or a compliant device configuration at fixed intervals.

    When you click sign In manually, you complete the MFA prompt, passing a valid token to the dataset. However, when the automated midnight background refresh fires, there is no human interactive interface to handle an MFA challenge. The identity provider rejects the background token request with an AccessDenied or TokenExpired failure code.

     

    2. Short OAuth2 Refresh Token Lifespans

    If your Azure Data Explorer (Kusto) tenant or your corporate Microsoft Entra ID enforces a strict lifespan limit on refresh tokens (e.g., 1 hour or 12 hours), the background data connector cannot refresh its security keys silently once that window closes, breaking the schedule until you click "Sign In" again.

     

    To fix this, you can try the following - 

    1. Transition to a Service Principal (Recommended Architecture)

    For business-critical dashboards, you should never lock a dataset refresh to an individual user's login. Instead, decouple the credentials using an Entra ID App Registration (Service Principal) as Parchitect has also recommended. Service Principals use secret keys or certificates that bypass interactive MFA challenges

     

    2. Work with IT Admin to Exempt the Service Account

    If you cannot use a Service Principal and must use a user account login:

    • Work with your IT/Security team to provision a dedicated Service Account 
    • Have your security team create an exemption rule in Microsoft Entra ID to exclude this specific account from Interactive Multi-Factor Authentication or Conditional Access location blocks when calling Azure Data Explorer API scopes.

    We prefer using service principal for refreshes in our organisation wherever possible.

    Let me know if this helps!