Configure OAuth (Public Preview) for Power BI

Preview

This feature is in Public Preview.

This article describes how to configure OAuth for authentication to Power BI. After you complete this one-time configuration as a Databricks account admin, users can use OAuth to sign in to Power BI.

Before you begin

Before you configure OAuth for Power BI:

Configure a .netrc file to securely pass credentials using cURL

This section describes how to configure a .netrc file to securely pass your Databricks username and password using cURL.

After you complete the one-time OAuth configuration steps in this article, you can remove the .netrc file.

Mac OS

Run the following command, replacing <Databricks account username> and <Databricks account password> with your credentials:

echo machine accounts.cloud.databricks.com login <Databricks account username> password <Databricks account password> >> ~/.netrc

Windows

  1. Run the following command:

    setx HOME %USERPROFILE%
    
  2. In a new terminal window, run the following command, replacing <Databricks account username> and <Databricks account password> with your credentials:

    cd %HOME%
    echo machine accounts.cloud.databricks.com login <Databricks account username> password <Databricks account password> >> .netrc
    

Enroll your Databricks account in OAuth

To enroll your Databricks account in OAuth, do the following:

  1. Run the following curl command:

    curl -n -X POST https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/enrollment
    
  2. To verify that your Databricks account is enrolled in OAuth, run the following curl command:

    curl -n -X GET https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/enrollment
    

    The following output is returned:

    {"is_enabled":true}
    

    Note

    Enrollment might take a few minutes. If enrollment isn’t complete yet, wait a few minutes and then run the enrollment verification command again.

Add Power BI as an OAuth application

To add Power BI as an OAuth application to your Databricks account, run the following curl command:

curl -n -X POST https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/published-app-integrations -d '{ "app_id" : "power-bi" }'

Important

(Windows) You must use double quotes around the data argument and escape all quotes inside this. For example:

curl -n -X POST https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/published-app-integrations -d "{ \"app_id\" : \"power-bi\" }"

The following output returns:

{"integration_id":"<Integration ID>"}

Next steps

You can now use OAuth to authenticate to Power BI Desktop, Power BI Service, and Power BI Gateway.

Connect to Power BI.