Create data recipients for OpenSharing (Databricks-to-Databricks sharing)
This page explains how to create recipients in OpenSharing, when the recipients are on a Databricks workspace that is enabled for Unity Catalog. To view, update, delete, grant share access, manage properties, or restrict access with IP lists for an existing recipient, see Manage data recipients for OpenSharing.
A recipient is the named object that represents the identity of a user or group of users who consume shared data. The way you create recipients differs depending on whether or not your recipient has access to a Databricks workspace that is enabled for Unity Catalog:
-
Recipients with access to a Unity Catalog-enabled Databricks workspace:
You can create a recipient object with a secure connection managed by Databricks. This sharing mode is called Databricks-to-Databricks sharing, and it is documented in this page.
-
Recipients without access to a Unity Catalog-enabled Databricks workspace:
You must use open sharing, with a secure connection that you manage using token-based authentication (either bearer tokens or OAuth federation). For information about creating Databricks-to-Open sharing recipients, see Enable Open ID Connect (OIDC) federation for OpenSharing recipients or Create a recipient object for non-Databricks users using bearer tokens (Databricks-to-Open sharing).
For more information about these two sharing modes and when to choose which, see Databricks-to-Open sharing versus Databricks-to-Databricks sharing.
Requirements
To create a recipient:
- You must have the
CREATE RECIPIENTprivilege for the Unity Catalog metastore where the data you want to share is registered. - You must create the recipient using a Databricks workspace that has that Unity Catalog metastore attached.
- If you use a Databricks notebook to create the recipient, your compute must use Databricks Runtime 11.3 LTS or above and either standard or dedicated access mode (formerly shared and single user access modes).
For permissions required for other recipient operations (view, update, delete, grant share access, manage properties), see Manage data recipients for OpenSharing.
Create a recipient object for Databricks users
If your data recipient has access to a Databricks workspace that has been enabled for Unity Catalog, you can create a recipient object with an authentication type of DATABRICKS.
A recipient object with the authentication type of DATABRICKS represents a data recipient on a particular Unity Catalog metastore, identified in the recipient object definition by a sharing identifier string consisting of the metastore's cloud, region, and UUID. The data shared with this recipient can be accessed only on that metastore.
To create a recipient for Databricks-to-Databricks sharing, use the Catalog Explorer, the Databricks CLI, or the CREATE RECIPIENT SQL command in a Databricks notebook or the Databricks SQL query editor. To create a recipient with the REST API, including an email recipient, see Create a recipient in the REST API reference.
Permissions required: Metastore admin or user with the CREATE RECIPIENT privilege for the Unity Catalog metastore where the data you want to share is registered.
- Catalog Explorer
- SQL
- CLI
-
In your Databricks workspace, click
Catalog.
-
At the top of the Catalog pane, click the
gear icon and select OpenSharing.
Alternatively, in the upper-right corner, click Share > OpenSharing.
-
On the Shared by me tab, click New recipient.
-
Choose how your recipient can access their shares:
-
Share using email (Beta): This sends an email to the recipient, prompting them to log in to their Databricks account and select the desired metastore. The recipient must sign in with a Databricks account that uses the invited email address. For more information and limitations, see email sharing.
- Enter the Recipient name.
- Enter the recipient's email address.
- For Configure how this share can be consumed, select Any supported OpenSharing client or Limit to Databricks recipients. Any supported OpenSharing client allows your recipient to download a credential file and access the share on Databricks.
- (Optional) Under Allowed metastores (via sharing ID), click Add metastore and enter a sharing identifier to limit which Databricks metastores can accept the invitation.
noteWhen you add a recipient to a share, OpenSharing emails the recipient a secure activation link, and sends a new email each time you add them to another share. Re-granting a share that a recipient already has doesn't trigger a duplicate email. See Manage access to OpenSharing data shares (for providers).
-
Share using sharing identifier: You need to ask for and input the recipient's sharing identifier.
-
Enter the Recipient name.
-
For Recipient type, select Databricks.
-
Enter the recipient's Sharing identifier.
Use the entire sharing identifier string in the format
<cloud>:<region>:<uuid>. For example,aws:us-west-2:19a84bee-54bc-43a2-87de-023d0ec16016. -
(Optional) Enter a comment.
-
-
-
Click Create.
-
(Optional) Create custom Recipient properties.
On the recipient Overview tab, click the
edit icon next to Recipient properties. Then add a property name (Key) and Value. For details, see Manage recipient properties.
Run the following command in a notebook or the Databricks SQL query editor:
CREATE RECIPIENT [IF NOT EXISTS] <recipient-name>
USING ID '<sharing-identifier>'
[COMMENT "<comment>"];
Use the entire sharing identifier string in the format <cloud>:<region>:<uuid>. For example, aws:eu-west-1:g0c979c8-3e68-4cdf-94af-d05c120ed1ef.
You can also add custom properties for the recipient. For details, see Manage recipient properties.
Run the following command using the Databricks CLI. Replace the placeholder values:
<recipient-name>: The name of the recipient.<sharing-identifier>: The entire sharing identifier string in the format<cloud>:<region>:<uuid>. For example,aws:eu-west-1:g0c979c8-3e68-4cdf-94af-d05c120ed1ef.<authentication-type>: Set toDATABRICKSwhen a sharing identifier string in the format<cloud>:<region>:<uuid>is provided for<sharing-identifier>.
databricks recipients create <recipient-name> <authentication-type> --sharing-code <sharing-identifier>
You can also add custom properties for the recipient. For details, see Manage recipient properties.
The recipient is created with the authentication_type of DATABRICKS.
Additional resources
- Manage access to OpenSharing data shares (for providers) — Grant the recipient access to one or more shares.
- Manage data recipients for OpenSharing — View, update, delete, manage properties, or restrict access for an existing recipient.
- Create shares for OpenSharing — Create the shares you want to grant the recipient access to.