Skip to content

Commit 4a572c6

Browse files
authored
Merge pull request #386 from segmentio/repo-sync
repo sync
2 parents 41c0e61 + 5375638 commit 4a572c6

File tree

1 file changed

+51
-41
lines changed
  • src/connections/storage/catalog/azuresqldw

1 file changed

+51
-41
lines changed

src/connections/storage/catalog/azuresqldw/index.md

Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,76 +5,86 @@ redirect_from:
55
- '/connections/warehouses/catalog/azuresqldw/'
66
---
77

8-
Azure's [Azure Synapse Analytics](https://azure.microsoft.com/en-us/services/synapse-analytics/), previously known as Azure SQL Data Warehouse, is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics.
8+
Azure's [Azure Synapse Analytics](https://azure.microsoft.com/en-us/services/synapse-analytics/){:target="_blank"}, previously known as Azure SQL Data Warehouse, is a limitless analytics service that brings together enterprise data warehousing and Big Data analytics.
99

1010
## Getting Started
1111

12-
There are four main steps to get started with Segment:
12+
Complete the following prerequisites in Microsoft Azure before connecting your Azure Synapse Analytics databases to Segment:
1313

14-
1. Have an [Azure subscription](https://azure.microsoft.com/en-us/free/)
15-
2. Provision [SQL Data Warehouse (Dedicated SQL Pool)](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal)
16-
3. Give Segment access to your SQL Data Warehouse
17-
4. Configure the Destination in Segment
14+
1. Sign up for an [Azure subscription](https://azure.microsoft.com/en-us/free/){:target="_blank"}.
15+
2. Provision a [Dedicated SQL Pool](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal){:target="_blank"}.
1816

19-
Follow the links above to follow Azure's documentation on setting up these prerequisites. Following that, the guide below should take you through the rest.
17+
## Connect your Azure database to Segment
2018

21-
### Give Segment access to your SQL Data Warehouse
22-
23-
First, create a server login for Segment to use. This can be accomplished by running the following SQL command on your SQL Server's `master` database.
24-
25-
```sql
26-
CREATE LOGIN Segment WITH PASSWORD = '<strong password>';
27-
```
28-
29-
Once this is done, no more action is needed for the `master` database. Next, connect to your Azure database in order to do some further configuration.
30-
31-
Segment uses Azure Blob Storage to hold data that is being loaded into Azure Synapse Analytics. In order to facilitate this, a `MASTER KEY` is needed in order for credentials that Segment saves to the database to be encrypted.
19+
To connect your Azure database to Segment, [give Segment access to your SQL Data Warehouse](#give-segment-access-to-your-sql-data-warehouse) and [configure an Azure Synapse Analytics destination](#configure-an-azure-synapse-analytics-destination-in-segment).
3220

33-
```sql
34-
CREATE MASTER KEY;
35-
```
36-
37-
**NOTE:** If you are using your Azure Synapse Analytics for things besides Segment, it is possible this is already done. Either way, running the command another time will not hurt anything.
21+
### Give Segment access to your SQL Data Warehouse
3822

39-
Next, create a new database user using the server login that was created previously:
23+
1. Create a server login for Segment to use. This can be accomplished by running the following SQL command on your SQL Server's `master` database:
24+
```sql
25+
CREATE LOGIN Segment WITH PASSWORD = '<strong password>';
26+
```
4027

41-
```sql
42-
CREATE USER Segment FOR LOGIN Segment;
43-
```
28+
2. Connect to your Azure database.
4429

45-
This new user will need permissions to load data, and manage the resources it needs. Run the following command to accomplish this:
30+
3. Segment uses Azure Blob Storage to hold data that is being loaded into Azure Synapse Analytics. In order to facilitate this, a `MASTER KEY` is needed in order for credentials that Segment saves to the database to be encrypted. To create a master key, run the following command:
31+
```sql
32+
CREATE MASTER KEY;
33+
```
34+
If you are using your Azure Synapse Analytics instance for more than just a Segment integration, it is possible you already have a master key. Running the command more than once will not create a new master key.
4635

47-
```sql
48-
GRANT CONTROL TO Segment;
49-
```
36+
4. Create a new database user using the server login that you created in a previous step:
37+
```sql
38+
CREATE USER Segment FOR LOGIN Segment;
39+
```
5040

51-
Lastly, assign this new user a [resource allocation class](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/resource-classes-for-workload-management). The default (`smallrc`) likely will not give Segment enough memory to perform bulk loads, so we recommend starting with `largerc`. The larger "Dynamic Resource Classes" give more memory, while allowing fewer concurrent queries, which is a better fit for Segment's loading strategy:
41+
5. Run the following command to give your new user the permissions to load data and manage the resources in your database:
42+
```sql
43+
GRANT CONTROL TO Segment;
44+
```
5245

53-
```sql
54-
EXEC sp_addrolemember 'largerc', 'Segment';
55-
```
46+
6. Assign this new user a [resource allocation class](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/resource-classes-for-workload-management){:target="_blank"}:
47+
```sql
48+
EXEC sp_addrolemember 'largerc', 'Segment';
49+
```
50+
The default resource allocation class (`smallrc`) may not give Segment enough memory to perform bulk loads, so Segment recommends starting with `largerc`. The larger Dynamic Resource Classes give more memory and allow fewer concurrent queries, which is a better fit for Segment's loading strategy.
5651

57-
By default, Azure Synapse Analytics cannot be connected to from the public internet. In order for Segment to connect, a [server-level firewall rule](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal#create-a-server-level-firewall-rule) that allows connections from the [Segment IPs](/docs/connections/storage/warehouses/faq/#which-ips-should-i-whitelist) is needed.
52+
7. By default, you cannot connect to Azure Synapse Analytics from the public internet. In order for Segment to connect to your instances, create a [server-level firewall rule](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal#create-a-server-level-firewall-rule){:target="_blank"} that allows connections from the [Segment IPs](/docs/connections/storage/warehouses/faq/#which-ips-should-i-allowlist):
53+
```sql
54+
EXEC sp_set_firewall_rule N'<rule name>', '52.25.130.38', '52.25.130.38';
55+
```
5856

59-
### Configure an Azure SQL Data Warehouse Destination in Segment
57+
### Configure an Azure Synapse Analytics Destination in Segment
6058

61-
In order to set up the necessary destination in Segment, you'll need the following pieces of information:
59+
In order to set up the Azure Synapse Analytics destination in Segment, you'll need the following pieces of information:
6260

6361
- **Server Name:** the name of the SQL Server resource that houses your SQL Data Warehouse
6462
- **Database:** the name of the SQL Data Warehouse database resource
6563
- **Username:** the name of the user you created above
6664
- **Password:** the password of the user you created above
6765

68-
All of these fields are required in order for Segment to load data into your SQL Data Warehouse. The username and password can be obtained during steps of the previous section, while the server and database names can be found in the Azure Portal.
66+
To add a Azure Synapse Analytics destination in the Segment app:
67+
1. Log in to Segment and select the **Connections** tab. Click **Add Destination**.
68+
2. Select the **Storage Destinations** tab and click the **Azure SQL Data Warehouse** destination.
69+
3. Select the source(s) you want to sync with the Azure SQL Data Warehouse destination, and click **Next**.
70+
4. Provide a name for your destination, and then enter data into each of the fields in the "Enter your Credentials" section. For the **Server Name** field, enter only the part of the server name prior to `.database.windows.net`.
71+
5. Click **Connect**.
72+
73+
> warning "Initial sync timeline"
74+
> The first sync after you configure your Azure Synapse destination with Segment can take up to 24 hours to complete.
6975
7076
## Best Practices
7177

7278
### Making sure Segment has enough resources to load your data
7379

74-
The default [resource allocation class](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/resource-classes-for-workload-management) (ie: `smallrc`) likely will not give Segment enough memory to perform bulk loads, so we recommend using a larger class (eg: `largerc`). Larger classes allocate more memory, but limit the number of concurrent queries, which is a better fit for Segment's loading strategy.
80+
The default [resource allocation class](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/resource-classes-for-workload-management){:target="_blank"} (`smallrc`) may not give Segment enough memory to perform bulk loads, so Segment recommends using a larger class (`largerc`). Larger classes allocate more memory and limit the number of concurrent queries, which is a better fit for Segment's loading strategy.
81+
82+
### Using Selective Sync
83+
84+
Users with a Business Tier plan can enable Selective Sync for their Azure Synapse Analytics destination. With Selective Sync, you can customize which collections and properties from a source are sent to each warehouse, which leads to faster, more relevant syncs. To learn more about Selective Sync, review the [Warehouse Syncs](/docs/connections/storage/warehouses/warehouse-syncs/#warehouse-selective-sync) documentation.
7585

7686
## Troubleshooting
7787

7888
### Segment is not able to connect to Azure Synapse Analytics
7989

80-
Make sure a [server-level firewall rule](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal#create-a-server-level-firewall-rule) that allows connections from the [Segment IPs](/docs/connections/storage/warehouses/faq/#which-ips-should-i-whitelist) is configured.
90+
If you encounter this error, create a [server-level firewall rule](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal#create-a-server-level-firewall-rule){:target="_blank"} that allows connections from the [Segment IPs](/docs/connections/storage/warehouses/faq/#which-ips-should-i-allowlist).

0 commit comments

Comments
 (0)