Share data and manage access to your SQL database in Microsoft Fabric
Applies to: ✅ SQL database in Microsoft Fabric
Fabric makes it easy to share items via the share button in the workspace. Fabric SQL database extends this experience by making it possible to share an item using granular SQL permissions. This allows things like sharing a single table in a database.
Prerequisites
- You need an existing Fabric capacity. If you don't, start a Fabric trial.
- Make sure that you Enable SQL database in Fabric using Admin Portal tenant settings.
- Create a new workspace or use an existing Fabric workspace.
- Create a new SQL database with the AdventureWorks sample data or use an existing database.
Share a database
Open your workspace containing the database in the Fabric portal.
In the list of items, or in an open item, select the Share button.
The Grant people access dialog opens. Enter the names of the people or groups that need access.
The dialog offers a few simple options to grant broad access to the SQL database for scenarios where a database has been created for a single user or purpose. We'll skip checking any of those boxes here.
Choose whether to notify recipients with an email and add a message.
Select Grant.
The users now have access to connect to the database but are unable to do anything yet. The users can be added to SQL roles by selecting Manage SQL security from the Security menu in the database editor.
Select the db_datareader role and then Manage Access.
Add the users to the role and select Save.
Select the db_datawriter role and then Manage Access.
Add the users to the role and select Save.
The users now have access to read and write every table within the database. They won't have rights on any other Fabric items in the workspace unless they have also been granted. Instead of the broad roles, consider that users could be granted rights on individual tables to follow the principle of least privilege.
Note
Microsoft Purview protection policies can augment effective permission for database users. If your organization uses Microsoft Purview with Microsoft Fabric, see Protect sensitive data in SQL database with Microsoft Purview protection policies.