|
22 | 22 | SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME() AS "Account Identifier" |
23 | 23 | ``` |
24 | 24 |
|
25 | | -- The Snowflake [user's login name (not its username) and its password](https://docs.snowflake.com/user-guide/admin-user-management#creating-users) in the account. |
| 25 | +- A Snowflake user, which can be a service user (recommended) or a human user. |
| 26 | + |
| 27 | + To create a service user (recommended): |
| 28 | + |
| 29 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 30 | + 2. In Snowsight, on the navigation menu, click **Projects > Worksheets**. |
| 31 | + 3. Click the **+** button to create a SQL worksheet. |
| 32 | + 4. In the worksheet, enter the following Snowflake query to create a service user, replacing the following placeholders: |
| 33 | + |
| 34 | + - Replace `<service-user-name>` with some name for the service user. |
| 35 | + - Replace `<default-role-name>` with the name of any default role for the service user to use. |
| 36 | + |
| 37 | + ```sql |
| 38 | + CREATE USER <service-user-name> |
| 39 | + DEFAULT_ROLE = "<default-role-name>" |
| 40 | + TYPE = SERVICE |
| 41 | + ``` |
| 42 | + |
| 43 | + 5. Click the arrow icon to run the worksheet, which creates the service user. |
| 44 | + |
| 45 | + To create a human user: |
| 46 | + |
| 47 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 48 | + 2. In Snowsight, on the navigation menu, click **Admin > Users & roles**. |
| 49 | + 3. Click the **Users** tab. |
| 50 | + 4. Click **+ User**. |
| 51 | + 5. Follow the on-screen guidance to specify the user's settings. |
| 52 | + 6. Click **Create User**. |
| 53 | + |
| 54 | +- The Snowflake [user's login name (not username)](https://docs.snowflake.com/user-guide/admin-user-management#creating-users) in the account, and |
| 55 | + a programmatic access token (PAT) for the Snowflake user. |
| 56 | + |
| 57 | + <iframe |
| 58 | + width="560" |
| 59 | + height="315" |
| 60 | + src="https://www.youtube.com/embed/sFLPGVe4VBM" |
| 61 | + title="YouTube video player" |
| 62 | + frameborder="0" |
| 63 | + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" |
| 64 | + allowfullscreen |
| 65 | + ></iframe> |
| 66 | + |
| 67 | + To view the login name for a user: |
| 68 | + |
| 69 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 70 | + 2. In Snowsight, on the navigation menu, click **Admin > Users & Roles**. |
| 71 | + 3. On the **Users** tab, in the list of available users, click the name of the target user. |
| 72 | + 4. In the **About** tile, note the **Login Name** for the user. |
| 73 | + |
| 74 | + Alternatively, the following Snowflake query returns information about the user with the username of `<my-user>`, including their `login_name` value representing their login name: |
| 75 | + |
| 76 | + ```text |
| 77 | + SHOW USERS LIKE '<my-user>'; |
| 78 | + ``` |
| 79 | + |
| 80 | + To create a programmatic access token (PAT) for a user: |
| 81 | + |
| 82 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 83 | + 2. In Snowsight, on the navigation menu, click **Admin > Users & Roles**. |
| 84 | + 3. On the **Users** tab, in the list of available users, click the name of the target user. |
| 85 | + 4. In the **Programmatic access tokens** tile, click the **Generate new token** button. |
| 86 | + 5. Follow the on-screen guidance to specify the PAT's settings. |
| 87 | + |
| 88 | + <Warning> |
| 89 | + You must set an expiration date for the PAT. This expiration date can be as soon as one day after the PAT is created or up to one year or even later. |
| 90 | + Once this PAT expires, the connector will stop working. |
| 91 | + To make sure that your connector continues to work, before your current PAT expires, you must follow this procedure again to generate a new PAT and |
| 92 | + update your connector's settings with your new PAT's value. |
| 93 | + |
| 94 | + Unstructured does not notify you when a PAT is about to expire or has already expired. |
| 95 | + You are responsible for tracking your PATs' expiration dates and taking corrective action before they expire. |
| 96 | + </Warning> |
| 97 | + |
| 98 | + 6. Click **Generate**. |
| 99 | + 7. Copy the generated PAT's value to a secure location, as you will not be able to access it again. If you lose this PAT's value, |
| 100 | + you will need to repeat this procedure to generate a new, replacement one. |
| 101 | + |
| 102 | + The PAT will not work unless the Snowflake account also has a valid |
| 103 | + [network rule](https://docs.snowflake.com/en/user-guide/network-rules) along with a valid |
| 104 | + [network policy](https://docs.snowflake.com/en/user-guide/network-policies) attached to that rule. |
| 105 | + The network rule must also be activated on the Snowflake account to begin taking effect. |
| 106 | + |
| 107 | + To create a valid network rule: |
| 108 | + |
| 109 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 110 | + 2. In Snowsight, on the navigation menu, click **Admin > Security > Network Rules**. |
| 111 | + 3. Click **+ Network Rule**. |
| 112 | + 4. Enter some name for the network rule. |
| 113 | + 5. For **Type**, select **IPv4**. |
| 114 | + 6. For **Mode**, select **Ingress**. |
| 115 | + 7. For **Identifiers**, next to the magnifying glass icon, enter `0.0.0.0/0`, and then press **Enter**. |
| 116 | + |
| 117 | + <Note> |
| 118 | + The `0.0.0.0/0` value allows all IP addresses to access the Snowflake account. |
| 119 | + You can specify a more specific IP address range if you prefer. However, this more specific IP address range |
| 120 | + will apply to all users, including the user for which you created the PAT. |
| 121 | + </Note> |
| 122 | + |
| 123 | + 8. Click **Create Network Rule**. |
| 124 | + |
| 125 | + To create a valid network policy, attaching the preceding network rule to this policy at the same time: |
| 126 | + |
| 127 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 128 | + 2. In Snowsight, on the navigation menu, click **Admin > Security > Network Policies**. |
| 129 | + 3. Click **+ Network Policy**. |
| 130 | + 4. Enter some name for the network policy. |
| 131 | + 5. Make sure **Allowed** is selected. |
| 132 | + 5. In the **Select rule** drop-down list, select the precedingnetwork rule to attach to this network policy. |
| 133 | + 6. Click **Create Network Policy**. |
| 134 | + |
| 135 | + To activate the network rule in the account: |
| 136 | + |
| 137 | + 1. Log in to [Snowsight](https://docs.snowflake.com/user-guide/ui-snowsight-homepage) with your Snowflake account. |
| 138 | + 2. In Snowsight, on the navigation menu, click **Admin > Security > Network Policies**. |
| 139 | + 3. Click the name of the precedingnetwork policy to activate. |
| 140 | + 4. In the policy's side panel, click the ellipsis (three dots) icon, and then click **Activate On Account**. |
| 141 | + 5. Click **Activate policy**. |
| 142 | + |
| 143 | +- (No longer recommended, as passwords are being deprecated by Snowflake—use PATs instead) The Snowflake [user's login name (not username) and the user's password](https://docs.snowflake.com/user-guide/admin-user-management#creating-users) in the account. |
| 144 | + This user must be a human user. Passwords are not supported for service users. |
26 | 145 |
|
27 | 146 | <iframe |
28 | 147 | width="560" |
|
0 commit comments