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
Copy file name to clipboardExpand all lines: articles/purview/register-scan-snowflake.md
+80-5Lines changed: 80 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.author: jingwang
6
6
ms.service: purview
7
7
ms.subservice: purview-data-map
8
8
ms.topic: how-to #Required; leave this attribute/value as-is.
9
-
ms.date: 11/19/2021
9
+
ms.date: 12/15/2021
10
10
ms.custom: template-how-to #Required; leave this attribute/value as-is.
11
11
---
12
12
@@ -42,7 +42,71 @@ When scanning Snowflake, Purview supports:
42
42
43
43
* Ensure Visual C++ Redistributable for Visual Studio 2012 Update 4 is installed on the self-hosted integration runtime machine. If you don't have this update installed, [you can download it here](https://www.microsoft.com/download/details.aspx?id=30679).
44
44
45
-
* The Snowflake user must have read access to system tables in order to access advanced metadata.
45
+
### Required permissions for scan
46
+
47
+
Azure Purview supports basic authentication (username and password) for scanning Snowflake. The default role of the given user will be used. The Snowflake user must have read access to system tables in order to access advanced metadata. Here is a sample walkthrough to set up the permission. If you choose to use an existing user, make sure it has adequate rights.
48
+
49
+
1. Set up a `purview_reader` role. You will need _ACCOUNTADMIN_ rights to do this.
50
+
51
+
```sql
52
+
USE ROLE ACCOUNTADMIN;
53
+
54
+
--create role to allow read only access - this will later be assigned to the purview USER
55
+
CREATE OR REPLACE ROLE purview_reader;
56
+
57
+
--make sysadmin the parent role
58
+
GRANT ROLE purview_reader TO ROLE sysadmin;
59
+
```
60
+
61
+
2. Create a warehouse for Purview to use and grant rights.
62
+
63
+
```sql
64
+
--create warehouse - account admin required
65
+
CREATE OR REPLACE WAREHOUSE purview_wh WITH
66
+
WAREHOUSE_SIZE ='XSMALL'
67
+
WAREHOUSE_TYPE ='STANDARD'
68
+
AUTO_SUSPEND =300
69
+
AUTO_RESUME = TRUE
70
+
MIN_CLUSTER_COUNT =1
71
+
MAX_CLUSTER_COUNT =2
72
+
SCALING_POLICY ='STANDARD';
73
+
74
+
--grant rights to the warehouse
75
+
GRANT USAGE ON WAREHOUSE purview_wh TO ROLE purview_reader;
76
+
```
77
+
78
+
3. Create a USER `purview` for Purview scan.
79
+
80
+
```sql
81
+
CREATE OR REPLACEUSERpurview
82
+
PASSWORD ='<password>';
83
+
84
+
--note the default role will be used during scan
85
+
ALTERUSER purview SET DEFAULT_ROLE = purview_reader;
86
+
87
+
--add user to purview_reader role
88
+
GRANT ROLE purview_reader TO USER purview;
89
+
```
90
+
91
+
4. Grant reader rights to the database objects.
92
+
93
+
```sql
94
+
--grant reader access to all the database structures that purview can currently scan
95
+
GRANT USAGE ON ALL SCHEMAS IN DATABASE <your_database_name> TO role purview_reader;
96
+
GRANT USAGE ON ALL FUNCTIONS IN DATABASE <your_database_name> TO role purview_reader;
97
+
GRANT USAGE ON ALL PROCEDURES IN DATABASE <your_database_name> TO role purview_reader;
98
+
GRANTSELECTON ALL TABLES IN DATABASE <your_database_name> TO role purview_reader;
99
+
GRANTSELECTON ALL VIEWS IN DATABASE <your_database_name> TO role purview_reader;
100
+
GRANT USAGE, READ on ALL STAGES IN DATABASE <your_database_name> TO role purview_reader;
101
+
102
+
--grant reader access to any future objects that could be created
103
+
GRANT USAGE ON FUTURE SCHEMAS IN DATABASE <your_database_name> TO role purview_reader;
104
+
GRANT USAGE ON FUTURE FUNCTIONS IN DATABASE <your_database_name> TO role purview_reader;
105
+
GRANT USAGE ON FUTURE PROCEDURES IN DATABASE <your_database_name> TO role purview_reader;
106
+
GRANTSELECTON FUTURE TABLES IN DATABASE <your_database_name> TO role purview_reader;
107
+
GRANTSELECTON FUTURE VIEWS IN DATABASE <your_database_name> TO role purview_reader;
108
+
GRANT USAGE, READ ON FUTURE STAGES IN DATABASE <your_database_name> TO role purview_reader;
109
+
```
46
110
47
111
## Register
48
112
@@ -61,7 +125,7 @@ On the **Register sources (Snowflake)** screen, do the following:
61
125
62
126
1. Enter a **Name** that the data source will be listed within the Catalog.
63
127
64
-
1. Enter the **server** URL used to connect to the Snowflake account, for example, `xy12345.east-us-2.azure.snowflakecomputing.com`.
128
+
1. Enter the **server** URL used to connect to the Snowflake account in the form of `<account_identifier>.snowflakecomputing.com`, for example, `xy12345.east-us-2.azure.snowflakecomputing.com`. Learn more about Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html#).
65
129
66
130
1. Select a collection or create a new one (Optional)
67
131
@@ -101,9 +165,9 @@ To create and run a new scan, do the following:
101
165
* Provide the user name used to connect to Snowflake in the User name input field.
102
166
* Store the user password used to connect to Snowflake in the secret key.
103
167
104
-
1.**Warehouse**: Specify the name of the warehouse instance to use.
168
+
1.**Warehouse**: Specify the name of the warehouse instance used to empower scan in capital case. The default role assigned to the user specified in the credential must have USAGE rights on this warehouse.
105
169
106
-
1.**Database**: Specify the name of the database instance to import.
170
+
1.**Database**: Specify the name of the database instance to import in capital case. The default role assigned to the user specified in the credential must have adequate rights on the database objects.
107
171
108
172
1.**Schema**: List subset of schemas to import expressed as a semicolon separated list. For example, `schema1; schema2`. All user schemas are imported if that list is empty. All system schemas and objects are ignored by default.
109
173
@@ -130,6 +194,17 @@ To create and run a new scan, do the following:
130
194
131
195
[!INCLUDE [create and manage scans](includes/view-and-manage-scans.md)]
132
196
197
+
## Troubleshooting tips
198
+
199
+
- Check your account identifer in the source registration step. Do not include `https://` part at the front.
200
+
- Make sure the warehouse name and database name are in capital case on the scan setup page.
201
+
- Check your key vault. Make sure there are no typos in the password.
202
+
- Check the credential you set up in Purview. The user you specify must have a default role with the necessary access rights to both the warehouse and the database you are trying to scan. See [Required permissions for scan](#required-permissions-for-scan). USE `DESCRIBE USER;` to verify the default role of the user you've specified for Purview.
203
+
- Use Query History in Snowflake to see if any activity is coming across.
204
+
- If there's a problem with the account identifer or password, you won't see any activity.
205
+
- If there's a problem with the default role, you should at least see a `USE WAREHOUSE . . .` statement.
206
+
- You can use the [QUERY_HISTORY_BY_USER table function](https://docs.snowflake.com/en/sql-reference/functions/query_history.html) to identify what role is being used by the connection. Setting up a dedicated Purview user will make troubleshooting easier.
207
+
133
208
## Next steps
134
209
135
210
Now that you have registered your source, follow the below guides to learn more about Purview and your data.
0 commit comments