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
{{ message }}
Repository navigation
Commit e59ba7a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/advanced-analytics/concepts/extensibility-framework.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ The architecture is designed such that external scripts run in a separate proces
44
44
45
45
Components include a **Launchpad** service used to invoke language-specific launchers (R or Python), language and library-specific logic for loading interpreters and libraries. The Launcher loads a language run time, plus any proprietary modules. For example, if your code includes RevoScaleR functions, a RevoScaleR interpreter would load. **BxlServer** and **SQL Satellite** manage communication and data transfer with SQL Server.
46
46
47
+
<aname="launchpad"></a>
48
+
47
49
## Launchpad
48
50
49
51
The SQL Server Trusted Launchpad is a service that manages and executes external scripts, similar to the way that the full-text indexing and query service launches a separate host for processing full-text queries. The Launchpad service can start only trusted launchers that are published by Microsoft, or that have been certified by Microsoft as meeting requirements for performance and resource management.
Copy file name to clipboardExpand all lines: docs/advanced-analytics/concepts/security.md
+5-25Lines changed: 5 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,35 +22,15 @@ This article describes the overall security architecture that is used to connect
22
22
23
23
## User security
24
24
25
-
A SQL Server login or Windows user account is required to run external scripts that use SQL Server data or that run with SQL Server as the compute context.
25
+
A SQL Server login or Windows user account is required to run external scripts that use SQL Server data or that run with SQL Server as the compute context.
26
26
27
-
The login or user account identifies the *security principal*, who might need multiple levels of access, depending on the external script requirements:
27
+
+ For SQL logins: Ensure that the login has appropriate permissions on the database where you are reading data. You can do this by adding *Connect to* and *SELECT* permissions, or by adding the login to the `db_datareader` role. To create objects, assign `DDL_admin` rights. If you must save data to tables, add to the `db_datawriter` role.
28
28
29
-
+ Permission to access the database where external scripts are enabled.
30
-
+ Permissions to read data from secured objects such as tables.
31
-
+ The ability to write new data to a table, such as a model, or scoring results.
32
-
+ The ability to create new objects, such as tables, stored procedures that use the external script, or custom functions that use R or Python job.
33
-
+ The right to install new packages on the SQL Server computer, or use packages provided to a group of users.
29
+
+ For Windows authentication: You might need to create an ODBC data source on the data science client that specifies the instance name and other connection information. For more information, see [ODBC data source administrator](../../odbc/admin/odbc-data-source-administrator.md).
34
30
35
-
Therefore, each person who runs an external script using SQL Server as the execution context must be mapped to a user in the database. Under SQL Server security, it is easiest to create roles to manage sets of permissions, and assign users to those roles, rather than individually set user permissions.
31
+
For more information, see [Give users permission to SQL Server Machine Learning Services](../../advanced-analytics/administration/user-permission.md).
36
32
37
-
Even users who are using R or Python in an external tool must be mapped to a login or account in the database if the user needs to run an external script in-database, or access database objects and data. The same permissions are required whether the external script is sent from a remote data science client or started using a T-SQL stored procedure.
38
-
39
-
For example, assume that you created an external script that runs on your local computer, and you want to run that code on SQL Server. You must ensure that the following conditions are met:
40
-
41
-
+ The database allows remote connections.
42
-
+ The SQL login or Windows account that you used for database access has been added to the SQL Server at the instance level.
43
-
+ The SQL login or Windows user must have the permission to execute external scripts. Generally, this permission can only be added by a database administrator.
44
-
+ The SQL login or Window user must be added as a user, with appropriate permissions, in each database where the external script performs any of these operations:
45
-
+ Retrieving data.
46
-
+ Writing or updating data.
47
-
+ Creating new objects, such as tables or stored procedures.
48
-
49
-
After the login or Windows user account has been provisioned and given the necessary permissions, you can run an external script on SQL Server by using a data source object in R or the **revoscalepy** library in Python, or by calling a stored procedure that contains the external script.
50
-
51
-
Whenever an external script is launched from SQL Server, the database engine security gets the security context of the user who started the job, and manages the mappings of the user or login to securable objects.
52
-
53
-
Therefore, all external scripts that are initiated from a remote client must specify the login or user information as part of the connection string.
On the database, you might need the following configuration updates:
228
-
229
-
* [Extend built-in permissions to remote users](#bkmk_configureAccounts)
230
-
* [Grant permission to run external scripts](#permissions-external-script)
231
-
* [Grant access to individual databases](#permissions-db)
232
-
233
-
> [!NOTE]
234
-
> Whether additional configuration is required depends on your security schema, where you installed SQL Server, and how you expect users to connect to the database and run external scripts.
235
-
236
227
<a name="bkmk_configureAccounts"></a>
237
228
<a name="permissions-external-script"></a>
238
229
239
-
For user security and connectivity, additional configuration might include:
230
+
On the database, you might need the following configuration updates:
240
231
241
232
* [Security configuration for SQLRUserGroup](../../advanced-analytics/security/firewall-configuration.md)
242
233
* [Give users permission to SQL Server Machine Learning Services](../../advanced-analytics/security/user-permission.md)
243
234
* [Connect to SQL Server Machine Learning Services from your data science client computer](../../advanced-analytics/security/connect-from-client-computer.md)
244
235
236
+
> [!NOTE]
237
+
> Whether additional configuration is required depends on your security schema, where you installed SQL Server, and how you expect users to connect to the database and run external scripts.
238
+
245
239
## Suggested optimizations
246
240
247
241
Now that you have everything working, you might also want to optimize the server to support machine learning, or install pretrained models.
Copy file name to clipboardExpand all lines: docs/advanced-analytics/install/sql-r-services-windows-install.md
+8-71Lines changed: 8 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,86 +183,23 @@ If the external script verification step was successful, you can run Python comm
183
183
184
184
If you got an error when running the command, review the additional configuration steps in this section. You might need to make additional appropriate configurations to the service or database.
185
185
186
-
Common scenarios that require additional changes include:
186
+
At the instance level, additional configuration might include:
187
187
188
-
* [Configure Windows firewall for in-bound connections](../../database-engine/configure-windows/configure-a-windows-firewall-for-database-engine-access.md)
188
+
* [Firewall configuration for SQL Server Machine Learning Services](../../advanced-analytics/security/firewall-configuration.md)
* [Extend built-in permissions to remote users](#bkmk_configureAccounts)
192
-
* [Grant permission to run external scripts](#bkmk_AllowLogon)
193
-
* [Grant access to individual databases](#permissions-db)
194
-
195
-
> [!NOTE]
196
-
> Not all the listed changes are required, and none might be required. Requirements depend on your security schema, where you installed SQL Server, and how you expect users to connect to the database and run external scripts. Additional troubleshooting tips can be found here: [Upgrade and installation FAQ](../r/upgrade-and-installation-faq-sql-server-r-services.md)
197
191
198
192
<a name="bkmk_configureAccounts"></a>
199
-
200
-
### Enable implied authentication for the Launchpad account group
201
-
202
-
During setup, some new Windows user accounts are created for running tasks under the security token of the [!INCLUDE[rsql_launchpad_md](../../includes/rsql-launchpad-md.md)] service. When a user sends an R script from an external client, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] activates an available worker account, maps it to the identity of the calling user, and runs the R script on behalf of the user. This new service of the database engine supports the secure execution of external scripts, called *implied authentication*.
203
-
204
-
You can view these accounts in the Windows user group **SQLRUserGroup**. By default, 20 worker accounts are created, which is usually more than enough for running R jobs.
205
-
206
-
However, if you need to run R scripts from a remote data science client and are using Windows authentication, you must grant these worker accounts permission to sign in to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance on your behalf.
207
-
208
-
1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], in Object Explorer, expand **Security**, right-click **Logins**, andselect**New Login**.
209
-
2. In the **Login - New** dialog box, select**Search**.
210
-
3. Select the **Object Types**and**Groups**check boxes, and clear all other check boxes.
211
-
4. Click **Advanced**, verify that the location to search is the current computer, and then click **Find Now**.
212
-
5. Scroll through the list of group accounts on the server until you find one beginning with `SQLRUserGroup`.
213
-
214
-
+ The name of the group that's associated with the Launchpad service for the _default instance_ is always just **SQLRUserGroup**. Select this account only for the default instance.
215
-
+ If you are using a _named instance_, the instance name is appended to the default name, `SQLRUserGroup`. Hence, if your instance is named "MLTEST", the default user group name for this instance would be **SQLRUserGroupMLTest**.
216
-
5. Click **OK** to close the advanced search dialog box, and verify that you've selected the correct account for the instance. Each instance can use only its own Launchpad service and the group created for that service.
217
-
6. Click **OK** once more to close the **Select User or Group** dialog box.
218
-
7. In the **Login - New** dialog box, click **OK**. By default, the login is assigned to the **public** role and has permission to connect to the database engine.
219
-
220
193
<a name="bkmk_AllowLogon"></a>
221
194
222
-
### Give users permission to run external scripts
223
-
224
-
> [!NOTE]
225
-
> If you use a SQL login for running R scripts in a SQL Server compute context, this step is not required.
226
-
227
-
If you installed [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] in your own instance, you are usually executing scripts as an administrator, or at least as a database owner, and thus have implicit permissions for various operations, all data in the database, and the ability to install new packages as needed.
228
-
229
-
However, in an enterprise scenario, most users, including users who access the database by using SQL logins, do not have such elevated permissions. Therefore, for each user who will be running R scripts, you must grant the user permissions to run scripts in each database where external scripts will be used.
195
+
On the database, you might need the following configuration updates:
230
196
231
-
```SQL
232
-
USE <database_name>
233
-
GO
234
-
GRANT EXECUTE ANY EXTERNAL SCRIPT TO [UserName]
235
-
```
197
+
* [Security configuration for SQLRUserGroup](../../advanced-analytics/security/firewall-configuration.md)
198
+
* [Give users permission to SQL Server Machine Learning Services](../../advanced-analytics/security/user-permission.md)
199
+
* [Connect to SQL Server Machine Learning Services from your data science client computer](../../advanced-analytics/security/connect-from-client-computer.md)
236
200
237
-
> [!TIP]
238
-
> Need help with setup? Not sure you have run all the steps? Use these custom reports to check installation status and run additional steps.
239
-
>
240
-
> [Monitor Machine Learning Services using Custom Reports](../r/monitor-r-services-using-custom-reports-in-management-studio.md).
241
-
242
-
<a name="permissions-db"></a>
243
-
244
-
### Give your users read, write, or DDL permissions to the database
245
-
246
-
The user account that is used to run R might need to read data from other databases, create new tables to store results, and write data into tables. Therefore, for each user who will be executing R scripts, ensure that the user has the appropriate permissions on the database: *db_datareader*, *db_datawriter*, or*db_ddladmin*.
247
-
248
-
For example, the following [!INCLUDE[tsql](../../includes/tsql-md.md)] statement gives the SQL login *MySQLLogin* the rights to run T-SQL queries in the *RSamples* database. To run this statement, the SQL login must already exist in the security context of the server.
For more information about the permissions included in each role, see [Database-level roles](../../relational-databases/security/authentication-access/database-level-roles.md).
257
-
258
-
259
-
### Create an ODBC data source for the instance on your data science client
260
-
261
-
If you create an R solution on a data science client computer and need to run code by using the SQL Server computer as the compute context, you can use either a SQL login or integrated Windows authentication.
262
-
263
-
* For SQL logins: Ensure that the login has appropriate permissions on the database where you will be reading data. You can do so by adding *Connect to*and*SELECT* permissions, or by adding the login to the *db_datareader* role. For logins that need to create objects, add *DDL_admin* rights. For logins that must save data to tables, add the login to the *db_datawriter* role.
264
-
265
-
* For Windows authentication: You might need to configure an ODBC data source on the data science client that specifies the instance name and other connection information. For more information, see [ODBC data source administrator](https://docs.microsoft.com/sql/odbc/admin/odbc-data-source-administrator).
201
+
> [!NOTE]
202
+
> Not all the listed changes are required, and none might be required. Requirements depend on your security schema, where you installed SQL Server, and how you expect users to connect to the database and run external scripts. Additional troubleshooting tips can be found here: [Upgrade and installation FAQ](../r/upgrade-and-installation-faq-sql-server-r-services.md)
Copy file name to clipboardExpand all lines: docs/advanced-analytics/security/add-sqlrusergroup-to-database.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,17 +15,18 @@ manager: cgronlun
15
15
16
16
This article explains how to give the group of worker accounts used by machine learning services in SQL Server the permissions required to connect to the database and run R or Python jobs on behalf of the user.
17
17
18
-
## What is SQLRUserGroup?
18
+
As part of the installation process for [!INCLUDE[rsql-productnamenew-md](../../includes/rsql-productnamenew-md.md)], a new Windows *user account pool*is created to support execution of tasks by the [!INCLUDE[rsql_launchpad](../../includes/rsql-launchpad-md.md)] service. The purpose of these worker accounts is to isolate concurrent execution of external scripts by different SQL users.
19
19
20
-
During setup of [!INCLUDE[rsql-productnamenew-md](../../includes/rsql-productnamenew-md.md)] or [!INCLUDE[rsql-productname-md](../../includes/rsql-productname-md.md)], new Windows user accounts are created to support execution of R or Python script tasks under the security token of the [!INCLUDE[rsql_launchpad_md](../../includes/rsql-launchpad-md.md)] service.
20
+
For more information, see the Launchpad section in [Security overview](../../advanced-analytics/concepts/security.md#launchpad).
21
21
22
-
You can view these accounts in the Windows user group **SQLRUserGroup**. By default, 20 worker accounts are created, which is usually more than enough for running machine learning jobs.
22
+
## Add SQLRUserGroup as a SQL Server login
23
23
24
-
When a user sends a machine learning script from an external client, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]activates an available worker account, maps it to the identity of the calling user, and runs the script on behalf of the user. This new service of the database engine supports the secure execution of external scripts, called *implied authentication*.
24
+
By default, the group of worker accounts does **not** have login permissions on the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]instance with which it is associated. This can be a problem if any R or Python users connect to SQL Server from a remote client to run external scripts, or if a script uses ODBC to get additional data.
25
25
26
-
However, if you need to run R or Python scripts from a remote data science client, and you are using Windows authentication, you must give these worker accounts permission to sign in to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance on your behalf.
26
+
If you need to run scripts from a remote data science client, and you are using Windows authentication, additional configuration is required to give worker accounts running R and Python processes permission to sign in to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance on your behalf.
27
27
28
-
## Add SQLRUserGroup as a SQL Server login
28
+
> [!NOTE]
29
+
> If you use a **SQL login** for running scripts in a SQL Server compute context, this extra step is not required.
29
30
30
31
1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], in Object Explorer, expand **Security**, right-click **Logins**, and select **New Login**.
31
32
@@ -67,4 +68,4 @@ If you intend to make heavy use of machine learning, you can increase the number
67
68
68
69
+[Modify the user account pool for machine learning](../../advanced-analytics/administration/modify-user-account-pool.md)
69
70
70
-
By default, 20 accounts are created, which supports 20 concurrent sessions. Parallelized tasks do not consume additional accounts. For example, if a user runs a scoring task that uses parallel processing, the same worker account is reused for all threads.
71
+
By default, 20 accounts are created, which supports 20 concurrent sessions. Parallelized tasks do not consume additional accounts. For example, if a user runs a scoring task that uses parallel processing, the same worker account is reused for all threads.
0 commit comments