You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are four main steps to get started with Segment:
12
+
Complete the following prerequisites in Microsoft Azure before linking your Azure Synapse Analytics databases to Segment:
13
13
14
-
1. Have an [Azure subscription](https://azure.microsoft.com/en-us/free/){:target="_blank"}.
15
-
2. Provision [SQL Data Warehouse (Dedicated SQL Pool)](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/create-data-warehouse-portal){:target="_blank"}.
16
-
3. Give Segment access to your SQL Data Warehouse
17
-
4. Configure the Destination in Segment
14
+
1. Create 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"}.
18
16
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
20
18
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 once you've provisioned your dedicated SQL pool, [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).
32
20
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
38
22
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
+
```
40
27
41
-
```sql
42
-
CREATEUSERSegment FOR LOGIN Segment;
43
-
```
28
+
2. Connect to your Azure database.
44
29
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. 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.
31
+
```sql
32
+
CREATE MASTER KEY;
33
+
```
46
34
47
-
```sql
48
-
GRANT CONTROL TO Segment;
49
-
```
35
+
4. Create a new database user using the server login that was created previously:
36
+
```sql
37
+
CREATEUSERSegment FOR LOGIN Segment;
38
+
```
50
39
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){:target="_blank"}. 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:
40
+
5. This new user will need permissions to load data, and manage the resources it needs:
41
+
```sql
42
+
GRANT CONTROL TO Segment;
43
+
```
52
44
53
-
```sql
54
-
EXEC sp_addrolemember 'largerc', 'Segment';
55
-
```
45
+
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"}:
46
+
```sql
47
+
EXEC sp_addrolemember 'largerc', 'Segment';
48
+
```
49
+
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.
56
50
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){:target="_blank"} that allows connections from the [Segment IPs](/docs/connections/storage/warehouses/faq/#which-ips-should-i-whitelist){:target="_blank"} is needed.
51
+
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):
### Configure an Azure SQL Data Warehouse Destination in Segment
56
+
### Configure an Azure Synapse Analytics Destination in Segment
60
57
61
58
In order to set up the necessary destination in Segment, you'll need the following pieces of information:
62
59
63
-
-**Server Name:** the name of the SQL Server resource that houses your SQL Data Warehouse
60
+
-**Server Name:** the name of the SQL Server resource that houses your SQL Data Warehouse.
64
61
-**Database:** the name of the SQL Data Warehouse database resource
65
62
-**Username:** the name of the user you created above
66
63
-**Password:** the password of the user you created above
67
64
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.
65
+
To add a Azure Synapse Analytics destination in the Segment app:
66
+
1. Log in to Segment and select the **Connections** tab. Select **Add Destination**.
67
+
2. Select the **Storage Destinations** tab and click the **Azure SQL Data Warehouse** destination.
68
+
3. Select the source(s) you want to sync with the Azure SQL Data Warehouse destination, and click **Next**.
69
+
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`.
70
+
5. Click **Connect**.
71
+
72
+
> warning "Initial sync timeline"
73
+
> The first sync after you configure your Azure Synapse destination with Segment can take up to 24 hours to complete.
69
74
70
75
## Best Practices
71
76
72
77
### Making sure Segment has enough resources to load your data
73
78
74
-
The default [resource allocation class](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/resource-classes-for-workload-management){:target="_blank"} (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.
79
+
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.
80
+
81
+
### Using Selective Sync
82
+
83
+
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.
75
84
76
85
## Troubleshooting
77
86
78
87
### Segment is not able to connect to Azure Synapse Analytics
79
88
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){:target="_blank"} that allows connections from the [Segment IPs](/docs/connections/storage/warehouses/faq/#which-ips-should-i-whitelist){:target="_blank"} is configured.
89
+
Make sure you configure 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