Tutorial: Share data using Azure Data Share
In this tutorial, you will learn how to set up a new Azure Data Share and start sharing your data with customers and partners outside of your Azure organization.
In this tutorial, you'll learn how to:
- Create a Data Share.
- Add datasets to your Data Share.
- Enable a snapshot schedule for your Data Share.
- Add recipients to your Data Share.
- Azure Subscription: If you don't have an Azure subscription, create a free account before you begin.
- Your recipient's Azure login e-mail address (using their e-mail alias won't work).
- If the source Azure data store is in a different Azure subscription than the one you will use to create Data Share resource, register the Microsoft.DataShare resource provider in the subscription where the Azure data store is located.
Share from a storage account:
- An Azure Storage account: If you don't already have one, you can create an Azure Storage account
- Permission to write to the storage account, which is present in Microsoft.Storage/storageAccounts/write. This permission exists in the Contributor role.
- Permission to add role assignment to the storage account, which is present in Microsoft.Authorization/role assignments/write. This permission exists in the Owner role.
Share from a SQL-based source:
An Azure SQL Database or Azure Synapse Analytics (formerly Azure SQL Data Warehouse) with tables and views that you want to share.
Permission to write to the databases on SQL server, which is present in Microsoft.Sql/servers/databases/write. This permission exists in the Contributor role.
Permission for the data share to access the data warehouse. This can be done through the following steps:
Set yourself as the Azure Active Directory Admin for the SQL server.
Connect to the Azure SQL Database/Data Warehouse using Azure Active Directory.
Use Query Editor (preview) to execute the following script to add the Data Share resource Managed Identity as a db_datareader. You must connect using Active Directory and not SQL Server authentication.
create user "<share_acct_name>" from external provider; exec sp_addrolemember db_datareader, "<share_acct_name>";
Note that the <share_acc_name> is the name of your Data Share resource. If you have not created a Data Share resource as yet, you can come back to this pre-requisite later.
An Azure SQL Database User with 'db_datareader' access to navigate and select the tables and/or views you wish to share.
Client IP SQL Server Firewall access. This can be done through the following steps:
- In SQL server in Azure portal, navigate to Firewalls and virtual networks
- Click the on toggle to allow access to Azure Services.
- Click +Add client IP and click Save. Client IP address is subject to change. This process might need to be repeated the next time you are sharing SQL data from Azure portal. You can also add an IP range.
Share from Azure Data Explorer
- An Azure Data Explorer cluster with databases you want to share.
- Permission to write to Azure Data Explorer cluster, which is present in Microsoft.Kusto/clusters/write. This permission exists in the Contributor role.
- Permission to add role assignment to the Azure Data Explorer cluster, which is present in Microsoft.Authorization/role assignments/write. This permission exists in the Owner role.
Sign in to the Azure portal
Sign in to the Azure portal.
Create a Data Share Account
Create an Azure Data Share resource in an Azure resource group.
Select the Create a resource button (+) in the upper-left corner of the portal.
Search for Data Share.
Select Data Share and Select Create.
Fill out the basic details of your Azure Data Share resource with the following information.
Setting Suggested value Field description Name datashareacount Specify a name for your data share account. Subscription Your subscription Select the Azure subscription that you want to use for your data share account. Resource group test-resource-group Use an existing resource group or create a new resource group. Location East US 2 Select a region for your data share account.
Select Create to provision your data share account. Provisioning a new data share account typically takes about 2 minutes or less.
When the deployment is complete, select Go to resource.
Create a Data Share
Navigate to your Data Share Overview page.
Select Start sharing your data.
To add Datasets to your Data Share, select Add Datasets.
Select the dataset type that you would like to add. You will see a different list of dataset types depending on the share type (snapshot or in-place) you have selected in the previous step. If sharing from an Azure SQL Database or Azure SQL Data Warehouse, you will be prompted for some SQL credentials. Authenticate using the user you created as part of the prerequisites.
Navigate to the object you would like to share and select 'Add Datasets'.
In the Recipients tab, enter in the email addresses of your Data Consumer by selecting '+ Add Recipient'.
If you have selected snapshot share type, you can configure snapshot schedule to provide updates of your data to your data consumer.
Select a start time and recurrence interval.
In the Review + Create tab, review your Package Contents, Settings, Recipients, and Synchronization Settings. Select Create
Your Azure Data Share has now been created and the recipient of your Data Share is now ready to accept your invitation.
In this tutorial, you learnt how to create an Azure Data Share and invite recipients. To learn about how a Data Consumer can accept and receive a data share, continue to the accept and receive data tutorial.