Tutorial: Accept and receive data using Azure Data Share
In this tutorial, you will learn how to accept a data share invitation using Azure Data Share. You will learn how to receive data being shared with you, as well as how to enable a regular refresh interval to ensure that you always have the most recent snapshot of the data being shared with you.
- How to accept an Azure Data Share invitation
- Create an Azure Data Share account
- Specify a destination for your data
- Create a subscription to your data share for scheduled refresh
Before you can accept a data share invitation, you must provision a number of Azure resources, which are listed below.
Ensure that all pre-requisites are complete before accepting a data share invitation.
- Azure Subscription: If you don't have an Azure subscription, create a free account before you begin.
- A Data Share invitation: An invitation from Microsoft Azure with a subject titled "Azure Data Share invitation from firstname.lastname@example.org".
Receive data into a storage account:
- An Azure Storage account: If you don't already have one, you can create an Azure Storage account.
- Permission to add role assignment to the storage account, which is present in the Microsoft.Authorization/role assignments/write permission. This permission exists in the owner role.
- Resource Provider registration for Microsoft.DataShare. See the Azure Resource Providers documentation for information on how to do this.
To accept and receive an Azure Data Share, you must first register the Microsoft.DataShare resource provider and you must be an owner of the storage account that you accept data into. Follow the instructions documented in Troubleshoot Azure Data Share to register the data share resource provider as well as add yourself as an owner of the storage account.
Receive data into a SQL-based source:
- Permission for the data share MSI to access the Azure SQL Database or Azure SQL Data Warehouse. This can be done through the following steps:
- Set yourself as the Azure Active Directory Admin for the 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 MSI as a db_owner. You must connect using Active Directory and not SQL Server authentication.
create user <share_acct_name> from external provider; exec sp_addrolemember db_owner, <share_acct_name>;
Note that the <share_acc_name> is the name of your Data Share Account. If you have not created a Data Share account as yet, you can come back to this pre-requisite later.
- Client IP SQL Server Firewall access: This can be done through the following steps: 1. Navigate to Firewalls and Virtual Networks 1. Click the on toggle to allow access to Azure Services.
Once these pre-requisites are complete, you are ready to receive data into your SQL Server.
Sign in to the Azure portal
Sign in to the Azure portal.
Check your inbox for an invitation from your data provider. The invitation is from Microsoft Azure, titled Azure Data Share invitation from email@example.com. Take note of the share name to ensure you're accepting the correct share if there are multiple invitations.
Select on View invitation to see your invitation in Azure. This takes you to your Received Shares view.
Select the share you would like to view.
Under Target Data Share Account, select the Subscription and Resource Group that you'll be deploying your Data Share into.
For the Data Share Account field, select Create new if you don't have an existing Data Share account. Otherwise, select an existing Data Share account that you'd like to accept your data share into.
For the Received Share Name field, you may leave the default specified by the Data Provide, or specify a new name for the received share.
If you prefer to accept the invitation now but configure your storage at a later time, Select Accept and Configure later. This option allows you to configure your target storage account later. To continue configuring your storage later, see how to configure your storage account page for detailed steps on how to resume your data share configuration.
If you don't want to accept the invitation, Select Reject.
Under Target Storage Settings, select the Subscription, Resource group, and storage account that you'd like to receive your data into.
To receive regular refreshes of your data, make sure you enable the snapshot settings. Note that you will only see a snapshot setting schedule if your data provider has included it in the data share.
If you are receiving SQL-based data and would like to receive that data into a SQL-based source, visit our configure a dataset mapping how-to guide to learn how to configure a SQL Server as the destination for your dataset.
Trigger a snapshot
You can trigger a snapshot in the Received Shares -> Details tab by selecting Trigger snapshot. Here, you can trigger a full or incremental snapshot of your data. If it is your first time receiving data from your data provider, select full copy.
When the last run status is successful, open the storage account to view the received data.
To check which storage account you used, Select on Datasets.
To view a history of your snapshots, navigate to Received Shares -> History. Here you'll find a history of all snapshots that were generated for the past 60 days.
In this tutorial, you learnt how to accept and receive an Azure Data Share. To learn more about Azure Data Share concepts, continue to Concepts: Azure Data Share Terminology.