Skip to content

Commit efb05a4

Browse files
authored
Merge pull request #1 from SturgeonMi/Azure-SQL-database-patch-1
Update how-to-identity-based-data-access.md
2 parents 1840698 + f036986 commit efb05a4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

articles/machine-learning/how-to-identity-based-data-access.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@ adls2_dstore = Datastore.register_azure_data_lake_gen2(workspace=ws,
142142
account_name='myadls2')
143143
```
144144

145+
### Azure SQL database
146+
For an Azure SQL database, use [register_azure_sql_database()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.datastore.datastore?view=azure-ml-py#register-azure-sql-database-workspace--datastore-name--server-name--database-name--tenant-id-none--client-id-none--client-secret-none--resource-url-none--authority-url-none--endpoint-none--overwrite-false--username-none--password-none--subscription-id-none--resource-group-none--grant-workspace-access-false----kwargs-) to register a datastore that connects to an Azure SQL database storage.
147+
148+
The following code creates and registers the `credentialless_sqldb` datastore to the `ws` workspace and assigns it to the variable, `sqldb_dstore`. This datastore accesses the database `mydb` in the `myserver` SQL DB server.
149+
150+
```python
151+
# createn sqldatabase datastore without credentials
152+
153+
sqldb_dstore = Datastore.register_azure_sql_database(workspace=ws,
154+
datastore_name='credentialless_sqldb',
155+
server_name='myserver',
156+
database_name='mydb')
157+
158+
```
159+
145160
## Use data in storage
146161

147162
[Azure Machine Learning datasets](how-to-create-register-datasets.md) are the recommended way to interact with your data in storage with Azure Machine Learning.

0 commit comments

Comments
 (0)