Manage connections for Lakehouse Federation
This article describes how to list all Lakehouse Federation connections defined in a Unity Catalog metastore, get connection details, grant connection permissions, and drop connections using Catalog Explorer and SQL statements in notebooks or the Databricks SQL query editor. A connection is a securable object in Unity Catalog that specifies a path and credentials for accessing an external database system.
See also Create a connection.
If you prefer to use the REST API, see Azure Databricks reference documentation.
List connections
Permissions required: The list of connections returned depends on your role and permissions. Users with the USE CONNECTION
privilege on the metastore see all connections. Otherwise, you can view only the connections for which you are the connection object owner or have some privilege on.
Catalog Explorer
In your Azure Databricks workspace, click Catalog.
At the top of the Catalog pane, click the gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
The connections you have permission to see are listed, along with the URL, create date, owner, and comment.
SQL
Run the following command in a notebook or the Databricks SQL query editor. Optionally, replace <pattern>
with a LIKE
predicate.
SHOW CONNECTIONS [LIKE <pattern>];
Get connection details
Permissions required: Connection owner, USE CONNECTION
privilege on the metastore, or some privilege on the connection.
Catalog Explorer
In your Azure Databricks workspace, click Catalog.
At the top of the Catalog pane, click the gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
Find the connection and select it to view details.
SQL
Run the following command in a notebook or the Databricks SQL query editor.
DESCRIBE CONNECTION <connection-name>;
Grant and revoke permissions on connections
You can grant permission to use a connection to create foreign catalogs or to view details about a connection:
CREATE FOREIGN CATALOG
grants the ability to create a foreign catalog as a read-only mirror of a database in the data source described by the connection.USE CONNECTION
grants the ability to use the connection in Delta Live Tables to ingest data from the data source into Azure Databricks. However, if granted at the metastore level, it only allows viewing the details of connections in the metastore. Users must still be grantedUSE CONNECTION
on individual connections to use them.
Permissions required: Metastore admin or connection owner.
Catalog Explorer
To grant permission to use a connection:
In your Azure Databricks workspace, click Catalog.
At the top of the Catalog pane, click the gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
Find the connection and select it.
On the Permissions tab, click Grant.
On the Grant on
<connection-name>
dialog, start typing the user or group name or click the user menu to browse and select users and groups.Select the privileges you want to grant.
See the privilege descriptions in the section introduction.
Click Grant.
To revoke a connection privilege:
- Follow the preceding steps to get to the Permissions tab for the connection.
- Select the user or group whose privilege you want to revoke.
- Click Revoke both on the tab and on the confirmation dialog.
SQL
To grant the ability to create a foreign catalog using a connection, run the following command in a notebook or the Databricks SQL query editor.
GRANT CREATE FOREIGN CATALOG ON CONNECTION <connection-name> TO <user-name>;
To grant the ability to view the connection, run the following:
GRANT USE CONNECTION ON CONNECTION <connection-name> TO <user-name>;
To revoke a privilege, run the following, where <privilege>
is one of the privileges on the connection granted to the user:
REVOKE <privilege> ON CONNECTION <connection-name> FROM <user-name>;
Drop connections
Permissions required: Connection owner
Catalog Explorer
In your Azure Databricks workspace, click Catalog.
At the top of the Catalog pane, click the gear icon and select Connections from the menu.
Alternatively, from the Quick access page, click the External data > button and go to the Connections tab.
Find the connection and select it.
Click the kebab menu and select Delete.
On the confirmation dialog, click Delete.
SQL
Run the following command in a notebook or the Databricks SQL query editor.
DROP CONNECTION [IF EXISTS] <connection-name>;