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/machine-learning/service/how-to-access-data.md
+65-18Lines changed: 65 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,10 @@ services: machine-learning
6
6
ms.service: machine-learning
7
7
ms.subservice: core
8
8
ms.topic: conceptual
9
-
ms.author: sihhu
10
-
author: MayMSFT
9
+
ms.author: ylxiong
10
+
author: YLXiong1125
11
11
ms.reviewer: nibaccam
12
-
ms.date: 11/04/2019
12
+
ms.date: 12/10/2019
13
13
ms.custom: seodec18
14
14
15
15
# Customer intent: As an experienced Python developer, I need to make my data in Azure storage available to my remote compute to train my machine learning models.
@@ -62,35 +62,82 @@ The information you need to populate the register() method can be found via the
62
62
2. The **Overview** page provides information such as, the account name and container or file share name.
63
63
3. For authentication information, like account key or SAS token, navigate to **Account Keys** under the **Settings** pane on the left.
64
64
65
-
>[IMPORTANT]
65
+
>[!IMPORTANT]
66
66
> If your storage account is in a VNET, only Azure blob datastore creation is supported. Set the parameter, `grant_workspace_access` to `True` to grant your workspace access to your storage account.
67
67
68
-
The following examples show you to register an Azure Blob Container or an Azure File Share as a datastore.
68
+
The following examples show how to register an Azure Blob Container, an Azure File Share or an Azure SQL data as a datastore.
69
69
70
70
+ For an **Azure Blob Container Datastore**, use [`register_azure_blob-container()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.datastore(class)?view=azure-ml-py#register-azure-blob-container-workspace--datastore-name--container-name--account-name--sas-token-none--account-key-none--protocol-none--endpoint-none--overwrite-false--create-if-not-exists-false--skip-validation-false--blob-cache-timeout-none--grant-workspace-access-false--subscription-id-none--resource-group-none-)
71
71
72
72
The following code creates and registers the datastore, `my_datastore`, to the workspace, `ws`. This datastore accesses the Azure blob container, `my_blob_container`, on the Azure storage account, `my_storage_account` using the provided account key.
+ For an **Azure File Share Datastore**, use [`register_azure_file_share()`](https://docs.microsoft.com/python/api/azureml-core/azureml.core.datastore(class)?view=azure-ml-py#register-azure-file-share-workspace--datastore-name--file-share-name--account-name--sas-token-none--account-key-none--protocol-none--endpoint-none--overwrite-false--create-if-not-exists-false--skip-validation-false-).
84
88
85
89
The following code creates and registers the datastore, `my_datastore`, to the workspace, `ws`. This datastore accesses the Azure file share, `my_file_share`, on the Azure storage account, `my_storage_account` using the provided account key.
+ For an **Azure SQL Datastore**, 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-) to register a credential Datastore connected to an Azure SQL database. with SQL authentication or service principal permissions.
105
+
106
+
#### By SQL authentication
107
+
108
+
```python
109
+
sql_datastore_name="azsqlsdksql"
110
+
server_name=os.getenv("SQL_SERVERNAME", "<my-server-name>") # Name of Azure SQL server
111
+
database_name=os.getenv("SQL_DATBASENAME", "<my-database-name>") # Name of Azure SQL database
112
+
username=os.getenv("SQL_USER_NAME", "<my-sql-user-name>") # The username of the database user to access the database.
113
+
password=os.getenv("SQL_USER_PASSWORD", "<my-sql-user-password>") # The password of the database user to access the database.
If you prefer to use a RunConfig objectfor training, you need to set up a [DataReference](https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.data.data_reference.datareference?view=azure-ml-py) object.
291
+
If you prefer to use a RunConfig objectfor training, you need to set up a [DataReference](https://docs.microsoft.com/python/api/azureml-core/azureml.data.data_reference.datareference?view=azure-ml-py) object.
245
292
246
293
The following code shows how to work with a DataReference objectin an estimation pipeline. For the full example, see this [notebook](https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/machine-learning-pipelines/intro-to-pipelines/aml-pipelines-how-to-use-estimatorstep.ipynb).
0 commit comments