Forum Discussion
Resfesh Issues (DMTS_OAuthTokenRefreshFailedError)
Hello,
I regularly receive the following error in one of our Power BI models that is connected to Databricks:
Data source error: {"error":{"code":"DMTS_OAuthTokenRefreshFailedError","pbi.error":{"code":"DMTS_OAuthTokenRefreshFailedError","details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"[DataSource.Error] Web.Contents failed to get contents from [cluster name here] (400): Bad Request"}}],"exceptionCulprit":1}}
The engineer supporting the environment has advised that everything appears to be working correctly, and that the only occasional issues relate to column errors.
However, the issue persists and occurs almost daily. Manually selecting “Edit Credentials” in the dataset settings temporarily resolves the refresh issue, but only until the next occurrence.
Would anyone have any ideas on what could be causing this, or what areas would be worth investigating further?
Thank you.
Hi koralka,
Thanks for reaching fabric community, will happy to assist.This looks related to the stored OAuth credential/token used by Power BI Service for the Databricks source. Edit credentials will fix this issue temporarily.
Can you answer the questions below?
- Recreate the Databricks data source credentials in the semantic model settings.
- Confirm whether the connection uses a personal user OAuth login or a service principal.
- Check if Conditional Access, MFA/session policies, or token lifetime policies changed.
- Confirm the Databricks SQL warehouse/cluster is available during scheduled refresh.
- Make sure all queries use the same Databricks server/HTTP path, so Power BI does not store multiple credentials for similar sources.
Service principal authentication for Power BI and Databricks:
https://learn.microsoft.com/en-us/azure/databricks/partners/bi/power-bi-m2mPower BI refresh troubleshooting steps:
https://learn.microsoft.com/power-bi/connect-data/refresh-troubleshooting-refresh-scenariosPLease consider this as an accepted solution if it helps or give it some kudos.
Thanks,Here I am attaching some microsoft documentations, you can have a look to get the information. Can you allowed to update the connection to use service principal instead OAuth?
https://learn.microsoft.com/en-us/entra/identity/monitoring-health/how-to-view-applied-conditional-access-policies
https://learn.microsoft.com/en-us/entra/identity/conditional-access/troubleshoot-conditional-access
https://learn.microsoft.com/en-us/entra/identity-platform/configurable-token-lifetimesNote: I used AI only to help paraphrase this response.
8 Replies
- Lodha_JaydeepSolution Sage
Hi koralka,
Thanks for reaching fabric community, will happy to assist.This looks related to the stored OAuth credential/token used by Power BI Service for the Databricks source. Edit credentials will fix this issue temporarily.
Can you answer the questions below?
- Recreate the Databricks data source credentials in the semantic model settings.
- Confirm whether the connection uses a personal user OAuth login or a service principal.
- Check if Conditional Access, MFA/session policies, or token lifetime policies changed.
- Confirm the Databricks SQL warehouse/cluster is available during scheduled refresh.
- Make sure all queries use the same Databricks server/HTTP path, so Power BI does not store multiple credentials for similar sources.
Service principal authentication for Power BI and Databricks:
https://learn.microsoft.com/en-us/azure/databricks/partners/bi/power-bi-m2mPower BI refresh troubleshooting steps:
https://learn.microsoft.com/power-bi/connect-data/refresh-troubleshooting-refresh-scenariosPLease consider this as an accepted solution if it helps or give it some kudos.
Thanks,- koralkaHelper I
Hi Lodha_Jaydeep
Thank you for your answer!
To answer some questions:
- The connection uses personal user OAuth login
- Conditional Access, MFA/session policies, or token lifetime policies changed - where would I check that
- The Databricks SQL warehouse should be available during refresh
- All queries use the same HTTP path
I'd appreciate some further insight.
Thank you- Lodha_JaydeepSolution Sage
Here I am attaching some microsoft documentations, you can have a look to get the information. Can you allowed to update the connection to use service principal instead OAuth?
https://learn.microsoft.com/en-us/entra/identity/monitoring-health/how-to-view-applied-conditional-access-policies
https://learn.microsoft.com/en-us/entra/identity/conditional-access/troubleshoot-conditional-access
https://learn.microsoft.com/en-us/entra/identity-platform/configurable-token-lifetimesNote: I used AI only to help paraphrase this response.