Forum Discussion

Matias1256's avatar
Matias1256
Regular Visitor
1 year ago
Solved

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

  • 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.
    • Matias1256's avatar
      Matias1256
      Regular 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.

      • SaiTejaTalasila's avatar
        SaiTejaTalasila
        Super 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-kathullac's avatar
    v-kathullac
    Community 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

  • 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.

    • Matias1256's avatar
      Matias1256
      Regular Visitor

      Yes Key/PAT authentication works but not OAuth.

      • sergej_og's avatar
        sergej_og
        Super User

        Ok, you have a working approach.
        That's nice. Enjoy your data...

        Why do you want to use OAuth so badly?

  • v-kathullac's avatar
    v-kathullac
    Community Support

    Hi Matias1256  ,

    Thank you for reaching out to Microsoft Fabric Community Forum.

     

    can you try below debug steps to resolve your issue.

    1. Generate a Personal Access Token (PAT) from Databricks under User Settings > Access Tokens
    2. Copy and use the PAT as the Account key in the authentication section
    3. Ensure the Databricks user has permissions to access workspace, cluster, and SQL endpoints
    4. Verify the on-premises gateway is installed, configured, and online
    5. In your data source settings, set Authentication method to Key
    6. Check that the host URL in the data source path is correctly formatted:   {"host": "adb-<workspace-id>.<region>.azuredatabricks.net"}
    7. Use tools like Postman to test the token with a REST API call to validate it
    8. If the connection test fails but you’re confident in the setup, enable Skip test connection
    9. Make sure the gateway machine has internet access to reach the Databricks workspace
    10. Consider testing with a personal gateway mode in Power BI Desktop
    11. Recreate the data source in the gateway if configuration seems stuck or corrupted
    12. If issues persist, gather error logs and contact Microsoft or Databricks support for deeper analysis

    Regards,

    Chaithanya.