Forum Discussion
Unable to create PowerBI - Azure Databricks connection with OAuth
Hi,
I am unable to create connection from PowerBI to Azure Databricks with OAuth(Azure AD authentication). I have successfully created vnet data gateway and we can create connection using that exact gateway with PAT. So the issue only exists when trying to use OAuth.
Here is the error:
Unable to create connection for the following reason: OAuth login through the data gateway was unsuccessful. Specific error details available below and in the gateway logs.
Details: xxxx-vnet-gateway: The service returned an invalid token. Please contact your IT administrator if this issue persists. Please have this information handy if you choose to create a support ticket. Session Id: xxxxx RequestId: xxxxx Cluster URI: https://api.powerbi.com Status code: 400 Time: Thu May 22 2025 14:22:41 GMT+0300 (Eastern European Summer Time)
Hi Matias1256 ,
Use PAT authentication it will be good for production applications. We have a 50k + users tenant I never seen anyone using Oauth authentication on service with databricks connections.
Thanks,
Sai Teja
12 Replies
- BhavinVyas3003Super User
Update Gateway: Ensure the VNet Data Gateway is updated to the latest version. OAuth via gateway requires recent updates.
Enable OAuth in Gateway:
- Go to Power BI Service → Manage Gateways.
- Edit your Databricks data source.
- Under Authentication method, select OAuth2.
- Click Sign in and authenticate with an Azure AD user who has access to Databricks.
Check Azure AD App Permissions:
- Ensure Azure Databricks Enterprise App has admin consent and necessary Graph/API permissions.
- The user must have access to both the workspace and cluster in Databricks.
Token Mapping (if custom DNS or Private Link used):
- Ensure your token is valid and not being blocked by custom DNS settings or network isolation.
- Check Azure Private Link and DNS resolution settings.
- Matias1256Regular Visitor
Re-created the gateway, but we still have the same error. I cannot find Azure Databricks Enterprise App so that might be the issue. We have SCIM provisioning and related Enterprise Apps in place.
- SaiTejaTalasilaSuper User
Hi Matias1256 ,
Use PAT authentication it will be good for production applications. We have a 50k + users tenant I never seen anyone using Oauth authentication on service with databricks connections.
Thanks,
Sai Teja
- v-kathullacCommunity Support
Hi Matias1256 ,
we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Regards,Chaithanya
- sergej_ogSuper User
Working setup for me:
Using on-prem gateway and using Key as the auth method.
This key you can create within databricks env in your "user settings".
Of course, permissions need to be in place.
Maybe an alternative approach for you.- Matias1256Regular Visitor
Yes Key/PAT authentication works but not OAuth.
- sergej_ogSuper User
Ok, you have a working approach.
That's nice. Enjoy your data...
Why do you want to use OAuth so badly?
- v-kathullacCommunity Support
Hi Matias1256 ,
Thank you for reaching out to Microsoft Fabric Community Forum.
can you try below debug steps to resolve your issue.
- Generate a Personal Access Token (PAT) from Databricks under User Settings > Access Tokens
- Copy and use the PAT as the Account key in the authentication section
- Ensure the Databricks user has permissions to access workspace, cluster, and SQL endpoints
- Verify the on-premises gateway is installed, configured, and online
- In your data source settings, set Authentication method to Key
- Check that the host URL in the data source path is correctly formatted: {"host": "adb-<workspace-id>.<region>.azuredatabricks.net"}
- Use tools like Postman to test the token with a REST API call to validate it
- If the connection test fails but you’re confident in the setup, enable Skip test connection
- Make sure the gateway machine has internet access to reach the Databricks workspace
- Consider testing with a personal gateway mode in Power BI Desktop
- Recreate the data source in the gateway if configuration seems stuck or corrupted
- If issues persist, gather error logs and contact Microsoft or Databricks support for deeper analysis
Regards,
Chaithanya.
- Matias1256Regular Visitor
Hi,
We can create the connection with PAT as said in the first post. The problem is that OAuth doesn't work.
- v-kathullacCommunity Support
Hi sergej_og ,
I suggest reaching out to Microsoft Support by raising a ticket. Microsoft will analyze backend logs and provide a resolution
Below is the link to create Microsoft support ticket:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticketRegards,
Chaithanya.