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:
You must be a Databricks account administrator.
Install cURL or an alternative tool for issuing HTTP requests (Mac OS, Windows).
(Optional) To use a custom identity provider (IdP) for Power BI OAuth login, see Enable account single sign-on authentication using OIDC.
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
Run the following command:
setx HOME %USERPROFILE%
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:
Run the following
curl
command:curl -n -X POST https://accounts.cloud.databricks.com/api/2.0/accounts/<Account ID>/oauth2/enrollment
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>"}