Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

PowerBI refresh failed when connected to databricks- DMTS_OAuthTokenRefreshFailedError

Hi,
Could someone please help with the issue below:

We have a PowerBI report that is connected to the databricks using an Import mode. We are using OAuth as the authentication mode.
The report is scheduled for daily refresh. The report was refreshing successfully for past 6-7 days. But then it failed with the below 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 'https://servername.cloud.databricks.com/xxxx/x1/token' (400): Bad Request"}}],"exceptionCulprit":1}}}

This keeps happening once in a week. 

When it fails we have to go the PowerBIservice --> data source credentials and reauthenticate the credentials, only after which it will start working. 

What could be the issue here? 

FYI, the databricks cluster stays disabled until some query hits. 

1 ACCEPTED SOLUTION
v-ssriganesh
Community Support
Community Support

Hi @Anonymous,

Thanks for reaching out about the refresh failure you're experiencing with your Power BI report connected to Databricks. I understand that the report was refreshing successfully for several days but started failing with a "DMTS_OAuthTokenRefreshFailedError" once a week.

This error typically indicates an issue with refreshing the OAuth token used for authentication between Power BI and Databricks. Here are some possible causes and solutions to troubleshoot the problem:

You mentioned that the Databricks cluster stays disabled until a query hits it. This auto-shutdown behavior might be causing the token to expire before the scheduled refresh. To address this:

  • If possible, adjust your Databricks cluster settings to remain active for a specific period or continuously run low-resource queries to prevent automatic shutdowns. Alternatively, consider scheduling a simple query to the Databricks cluster just before your Power BI refresh. This will ensure the cluster is active and the token is valid for refresh.
  • Investigate the expiration time of OAuth tokens issued by Databricks. If they expire frequently (e.g., daily), it might lead to refresh failures around that time.
  • see if there's an option on the Databricks side to extend the validity period of OAuth tokens. This would reduce refresh attempts and potential failures.
  • While reauthenticating credentials in Power BI service after the refresh failure seems to resolve the issue temporarily, it's not an ideal long-term solution.

If these solutions do not resolve the issue, please consider contacting Databricks support or raising a Microsoft support ticket. You can create a Microsoft support ticket using the link below:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

If this helps then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.
Hope this works for you!
Thanks.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

The issue still persists. We have tried possible ways  like having the databricks started before the schedule refresh time , but did not help. 
Analysis in the databricks end is in progress. Meanwhile we have switched the report to use PAT token.

I resolved my issue by following these steps:

  1. Navigated to Manage Connections and Gateways in Power BI Online.
  2. On the Connections tab, located the Databricks entry (Connection type: Databricks) and clicked the three dots -> Settings.
  3. Under Authentication method, I ensured it was set to OAuth. Then, I clicked Edit credentials and refreshed them.
  4. Finally, clicked Save.

After completing these steps, the semantic model refreshed successfully! 🎉

 

@Rohan_B @Anonymous hope this work for you

Rohan_B
New Member

@Anonymous  Did you find a solution for this.

 

We tried the above options but the issue still persists. The token expires after 6 to 7 days even if we have set the Refresh token TTL (in minutes) to 43200 (30 days) at databricks.

 

We also set up a query to trigger at the same time the report refreshed to keep the serverless warehouse up during that time. That also did not work.

I'm having the same issue and it began today. So I'm guessing databricks is having a generalized problem.

Please let me know if you  figure out a solution.

Anonymous
Not applicable

@Anonymous  what did you end up doing? We are facing what sounds like the exact same issue.

v-ssriganesh
Community Support
Community Support

Hi @Anonymous,

Thanks for reaching out about the refresh failure you're experiencing with your Power BI report connected to Databricks. I understand that the report was refreshing successfully for several days but started failing with a "DMTS_OAuthTokenRefreshFailedError" once a week.

This error typically indicates an issue with refreshing the OAuth token used for authentication between Power BI and Databricks. Here are some possible causes and solutions to troubleshoot the problem:

You mentioned that the Databricks cluster stays disabled until a query hits it. This auto-shutdown behavior might be causing the token to expire before the scheduled refresh. To address this:

  • If possible, adjust your Databricks cluster settings to remain active for a specific period or continuously run low-resource queries to prevent automatic shutdowns. Alternatively, consider scheduling a simple query to the Databricks cluster just before your Power BI refresh. This will ensure the cluster is active and the token is valid for refresh.
  • Investigate the expiration time of OAuth tokens issued by Databricks. If they expire frequently (e.g., daily), it might lead to refresh failures around that time.
  • see if there's an option on the Databricks side to extend the validity period of OAuth tokens. This would reduce refresh attempts and potential failures.
  • While reauthenticating credentials in Power BI service after the refresh failure seems to resolve the issue temporarily, it's not an ideal long-term solution.

If these solutions do not resolve the issue, please consider contacting Databricks support or raising a Microsoft support ticket. You can create a Microsoft support ticket using the link below:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

If this helps then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.
Hope this works for you!
Thanks.

Anonymous
Not applicable

Thanks a lot for your immediate response and detailed explanation provided. We will try some of these options to see if it resolves the issue and provide an update here.

Did you find a solution @Anonymous ?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.