Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 98e936f

Browse files
committedAug 31, 2020
add how to
1 parent 28b58c7 commit 98e936f

13 files changed

+445
-14
lines changed
 

‎articles/data-share/TOC.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
href: supported-data-stores.md
1010
- name: Quickstarts
1111
items:
12-
- name: Create data share - Azure portal
12+
- name: Share data - Azure portal
1313
href: share-your-data-portal.md
14-
- name: Create data share - ARM template
14+
- name: Share data - ARM template
1515
displayName: Resource Manager
1616
href: share-your-data-arm.md
1717
- name: Tutorials
@@ -39,6 +39,10 @@
3939
items:
4040
- name: Share and receive data by source
4141
items:
42+
- name: Share from Azure Storage
43+
href: how-to-share-from-storage.md
44+
- name: Share from Azure SQL Database or Synapse Analytics
45+
href: how-to-share-from-sql.md
4246
- name: Share from Azure Data Explorer
4347
href: /azure/data-explorer/data-share
4448
maintainContext: true
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
---
2+
title: Share and receive data from Azure SQL Database and Azure Synapse Analytics
3+
description: Learn how to share and receive data from Azure Blob Storage and Azure Data Lake Storage
4+
author: jifems
5+
ms.author: jife
6+
ms.service: data-share
7+
ms.topic: how-to
8+
ms.date: 08/28/2020
9+
---
10+
# Share and receive data from Azure SQL Database and Azure Synapse Analytics
11+
12+
[!INCLUDE[appliesto-sql](includes/appliesto-sql.md)]
13+
14+
Azure Data Share supports snapshot-based sharing Azure SQL Database and Azure Synapse Analytics (formerly Azure SQL DW). This article explains how to share and receive data from these sources.
15+
16+
Azure Data Share supports sharing of tables or views from Azure SQL Database and Azure Synapse Analytics (formerly Azure SQL DW). Data consumers can choose to accept the data into Azure Data Lake Storage Gen2 or Azure Blob Storage as csv or parquet file, as well as into Azure SQL Database and Azure Synapse Analytics as tables.
17+
18+
When accepting data into Azure Data Lake Store Gen2 or Azure Blob Storage, full snapshots overwrite the contents of the target file if already exists.
19+
When data is received into table and if the target table does not already exist, Azure Data Share creates the SQL table with the source schema. If a target table already exists with the same name, it will be dropped and overwritten with the latest full snapshot. Incremental snapshots are not currently supported.
20+
21+
## Share data
22+
23+
### Prerequisites to share data
24+
25+
* Azure Subscription: If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
26+
* Your recipient's Azure login e-mail address (using their e-mail alias won't work).
27+
* 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](concepts-roles-permissions.md#resource-provider-registration) in the subscription where the Azure data store is located.
28+
29+
### Prerequisites for SQL source
30+
31+
* An Azure SQL Database or Azure Synapse Analytics (formerly Azure SQL Data Warehouse) with tables and views that you want to share.
32+
* 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.
33+
* Permission for the data share to access the data warehouse. This can be done through the following steps:
34+
1. Set yourself as the Azure Active Directory Admin for the SQL server.
35+
1. Connect to the Azure SQL Database/Data Warehouse using Azure Active Directory.
36+
1. 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.
37+
38+
```sql
39+
create user "<share_acct_name>" from external provider;
40+
exec sp_addrolemember db_datareader, "<share_acct_name>";
41+
```
42+
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.
43+
44+
* An Azure SQL Database User with 'db_datareader' access to navigate and select the tables and/or views you wish to share.
45+
46+
* Client IP SQL Server Firewall access. This can be done through the following steps:
47+
1. In SQL server in Azure portal, navigate to *Firewalls and virtual networks*
48+
1. Click the **on** toggle to allow access to Azure Services.
49+
1. 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.
50+
51+
### Sign in to the Azure portal
52+
53+
Sign in to the [Azure portal](https://portal.azure.com/).
54+
55+
### Create a Data Share Account
56+
57+
Create an Azure Data Share resource in an Azure resource group.
58+
59+
1. Select the menu button in the upper-left corner of the portal, then select **Create a resource** (+).
60+
61+
1. Search for *Data Share*.
62+
63+
1. Select Data Share and Select **Create**.
64+
65+
1. Fill out the basic details of your Azure Data Share resource with the following information.
66+
67+
**Setting** | **Suggested value** | **Field description**
68+
|---|---|---|
69+
| Subscription | Your subscription | Select the Azure subscription that you want to use for your data share account.|
70+
| Resource group | *test-resource-group* | Use an existing resource group or create a new resource group. |
71+
| Location | *East US 2* | Select a region for your data share account.
72+
| Name | *datashareaccount* | Specify a name for your data share account. |
73+
| | |
74+
75+
1. Select **Review + create**, then **Create** to provision your data share account. Provisioning a new data share account typically takes about 2 minutes or less.
76+
77+
1. When the deployment is complete, select **Go to resource**.
78+
79+
### Create a share
80+
81+
1. Navigate to your Data Share Overview page.
82+
83+
![Share your data](./media/share-receive-data.png "Share your data")
84+
85+
1. Select **Start sharing your data**.
86+
87+
1. Select **Create**.
88+
89+
1. Fill out the details for your Data Share. Specify a name, share type, description of share contents, and terms of use (optional).
90+
91+
![EnterShareDetails](./media/enter-share-details.png "Enter Share details")
92+
93+
1. Select **Continue**.
94+
95+
1. To add Datasets to your Data Share, select **Add Datasets**.
96+
97+
![Datasets](./media/datasets.png "Datasets")
98+
99+
1. 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.
100+
101+
![AddDatasets](./media/add-datasets.png "Add Datasets")
102+
103+
1. Select your SQL server, provide credentials and select **Next** to navigate to the object you would like to share and select 'Add Datasets'.
104+
105+
![SelectDatasets](./media/select-datasets-sql.png "Select Datasets")
106+
107+
1. In the Recipients tab, enter in the email addresses of your Data Consumer by selecting '+ Add Recipient'.
108+
109+
![AddRecipients](./media/add-recipient.png "Add recipients")
110+
111+
1. Select **Continue**.
112+
113+
1. If you have selected snapshot share type, you can configure snapshot schedule to provide updates of your data to your data consumer.
114+
115+
![EnableSnapshots](./media/enable-snapshots.png "Enable snapshots")
116+
117+
1. Select a start time and recurrence interval.
118+
119+
1. Select **Continue**.
120+
121+
1. In the Review + Create tab, review your Package Contents, Settings, Recipients, and Synchronization Settings. Select **Create**.
122+
123+
Your Azure Data Share has now been created and the recipient of your Data Share is now ready to accept your invitation.
124+
125+
## Receive data
126+
127+
### Prerequisites to receive data
128+
Before you can accept a data share invitation, you must provision a number of Azure resources, which are listed below.
129+
130+
Ensure that all pre-requisites are complete before accepting a data share invitation.
131+
132+
* Azure Subscription: If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/) before you begin.
133+
* A Data Share invitation: An invitation from Microsoft Azure with a subject titled "Azure Data Share invitation from **<yourdataprovider@domain.com>**".
134+
* Register the [Microsoft.DataShare resource provider](concepts-roles-permissions.md#resource-provider-registration) in the Azure subscription where you will create a Data Share resource and the Azure subscription where your target Azure data stores are located.
135+
136+
### Prerequisites for target storage account
137+
If you choose to receive data into Azure Storage, below is the list of prerequisites.
138+
139+
* An Azure Storage account: If you don't already have one, you can create an [Azure Storage account](https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account).
140+
* Permission to write to the storage account, which is present in *Microsoft.Storage/storageAccounts/write*. This permission exists in the Contributor role.
141+
* 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.
142+
143+
### Prerequisites for SQL target
144+
If you choose to receive data into Azure SQL Database, Azure Synapse Analytics, below is the list of prerequisites.
145+
146+
* Permission to write to databases on the SQL server, which is present in *Microsoft.Sql/servers/databases/write*. This permission exists in the Contributor role.
147+
* Permission for the data share resource's managed identity to access the Azure SQL Database or Azure SQL Data Warehouse. This can be done through the following steps:
148+
1. Set yourself as the Azure Active Directory Admin for the SQL server.
149+
1. Connect to the Azure SQL Database/Data Warehouse using Azure Active Directory.
150+
1. Use Query Editor (preview) to execute the following script to add the Data Share Managed Identity as a 'db_datareader, db_datawriter, db_ddladmin'. You must connect using Active Directory and not SQL Server authentication.
151+
152+
```sql
153+
create user "<share_acc_name>" from external provider;
154+
exec sp_addrolemember db_datareader, "<share_acc_name>";
155+
exec sp_addrolemember db_datawriter, "<share_acc_name>";
156+
exec sp_addrolemember db_ddladmin, "<share_acc_name>";
157+
```
158+
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.
159+
160+
* Client IP SQL Server Firewall access. This can be done through the following steps:
161+
1. In SQL server in Azure portal, navigate to *Firewalls and virtual networks*
162+
1. Click the **on** toggle to allow access to Azure Services.
163+
1. 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 receiving data into a SQL target from Azure portal. You can also add an IP range.
164+
165+
### Sign in to the Azure portal
166+
167+
Sign in to the [Azure portal](https://portal.azure.com/).
168+
169+
### Open invitation
170+
171+
1. You can open invitation from email or directly from Azure portal.
172+
173+
To open invitation from email, check your inbox for an invitation from your data provider. The invitation is from Microsoft Azure, titled **Azure Data Share invitation from <yourdataprovider@domain.com>**. Click on **View invitation** to see your invitation in Azure.
174+
175+
To open invitation from Azure portal directly, search for **Data Share Invitations** in Azure portal. This takes you to the list of Data Share invitations.
176+
177+
![Invitations](./media/invitations.png "List of invitations")
178+
179+
1. Select the share you would like to view.
180+
181+
### Accept invitation
182+
1. Make sure all fields are reviewed, including the **Terms of Use**. If you agree to the terms of use, you'll be required to check the box to indicate you agree.
183+
184+
![Terms of use](./media/terms-of-use.png "Terms of use")
185+
186+
1. Under *Target Data Share Account*, select the Subscription and Resource Group that you'll be deploying your Data Share into.
187+
188+
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.
189+
190+
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.
191+
192+
Once you've agreed to the terms of use and specified a Data Share account to manage your received share, Select **Accept and configure**. A share subscription will be created.
193+
194+
![Accept options](./media/accept-options.png "Accept options")
195+
196+
This takes you to your the received share in your Data Share account.
197+
198+
If you don't want to accept the invitation, Select *Reject*.
199+
200+
### Configure received share
201+
Follow the steps below to configure where you want to receive data.
202+
203+
1. Select **Datasets** tab. Check the box next to the dataset you'd like to assign a destination to. Select **+ Map to target** to choose a target data store.
204+
205+
![Map to target](./media/dataset-map-target.png "Map to target")
206+
207+
1. Select a target data store that you'd like the data to land in. Any data files or tables in the target data store with the same path and name will be overwritten.
208+
209+
![Target storage account](./media/dataset-map-target-sql.png "Target Data Store")
210+
211+
1. For snapshot-based sharing, if the data provider has created a snapshot schedule to provide regular update to the data, you can also enable snapshot schedule by selecting the **Snapshot Schedule** tab. Check the box next to the snapshot schedule and select **+ Enable**.
212+
213+
![Enable snapshot schedule](./media/enable-snapshot-schedule.png "Enable snapshot schedule")
214+
215+
### Trigger a snapshot
216+
These steps only apply to snapshot-based sharing.
217+
218+
1. You can trigger a snapshot by selecting **Details** tab followed by **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. For SQL sources, only full snapshot is supported.
219+
220+
![Trigger snapshot](./media/trigger-snapshot.png "Trigger snapshot")
221+
222+
1. When the last run status is *successful*, go to target data store to view the received data. Select **Datasets**, and click on the link in the Target Path.
223+
224+
![Consumer datasets](./media/consumer-datasets.png "Consumer dataset mapping")
225+
226+
### View history
227+
This step only applies to snapshot-based sharing. To view history of your snapshots, select **History** tab. Here you'll find history of all snapshots that were generated for the past 30 days.
228+
229+
## Next steps
230+
You have learned how to share and receive data from storage account using Azure Data Share service. To learn more about sharing from other data sources, continue to [supported data stores](supported-data-stores.md).
231+

0 commit comments

Comments
 (0)
Please sign in to comment.