Skip to content

Commit d0d3267

Browse files
author
Larry Franks
committed
example code.
1 parent 8f4ed01 commit d0d3267

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

articles/machine-learning/how-to-set-up-training-targets.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,29 @@ Use the Azure Data Science Virtual Machine (DSVM) as the Azure VM of choice for
149149
1. **Attach**: To attach an existing virtual machine as a compute target, you must provide the fully qualified domain name (FQDN), user name, and password for the virtual machine. In the example, replace \<fqdn> with the public FQDN of the VM, or the public IP address. Replace \<username> and \<password> with the SSH user name and password for the VM.
150150

151151
> [!IMPORTANT]
152-
> The following Azure regions do not support attaching a virtual machine using the public IP address of the VM. Instead, use the Azure Resource Manager ID of the VM:
152+
> The following Azure regions do not support attaching a virtual machine using the public IP address of the VM. Instead, use the Azure Resource Manager ID of the VM with the `resource_id` parameter:
153153
>
154154
> * US East
155155
> * US West 2
156156
> * US South Central
157+
>
158+
> The resource ID of the VM can be constructed using the subscription ID, resource group name, and VM name using the following string format: `/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Compute/virtualMachines/<vm_name>`.
159+
157160

158161
```python
159162
from azureml.core.compute import RemoteCompute, ComputeTarget
160163

161164
# Create the compute config
162165
compute_target_name = "attach-dsvm"
163-
attach_config = RemoteCompute.attach_configuration(address = "<fqdn>",
166+
attach_config = RemoteCompute.attach_configuration(address='<fqdn>',
164167
ssh_port=22,
165168
username='<username>',
166169
password="<password>")
170+
# If in US East, US West 2, or US South Central, use the following instead:
171+
# attach_config = RemoteCompute.attach_configuration(resource_id='<resource_id>',
172+
# ssh_port=22,
173+
# username='<username>',
174+
# password="<password>")
167175

168176
# If you authenticate with SSH keys instead, use this code:
169177
# ssh_port=22,
@@ -200,11 +208,13 @@ Azure HDInsight is a popular platform for big-data analytics. The platform provi
200208
1. **Attach**: To attach an HDInsight cluster as a compute target, you must provide the hostname, user name, and password for the HDInsight cluster. The following example uses the SDK to attach a cluster to your workspace. In the example, replace \<clustername> with the name of your cluster. Replace \<username> and \<password> with the SSH user name and password for the cluster.
201209

202210
> [!IMPORTANT]
203-
> The following Azure regions do not support attaching an HDInsight cluster using the public IP address of the cluster. Instead, use the Azure Resource Manager ID of the cluster:
211+
> The following Azure regions do not support attaching an HDInsight cluster using the public IP address of the cluster. Instead, use the Azure Resource Manager ID of the cluster with the `resource_id` parameter:
204212
>
205213
> * US East
206214
> * US West 2
207215
> * US South Central
216+
>
217+
> The resource ID of the cluster can be constructed using the subscription ID, resource group name, and cluster name using the following string format: `/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.HDInsight/clusters/<cluster_name>`.
208218
209219
```python
210220
from azureml.core.compute import ComputeTarget, HDInsightCompute
@@ -216,6 +226,11 @@ Azure HDInsight is a popular platform for big-data analytics. The platform provi
216226
ssh_port=22,
217227
username='<ssh-username>',
218228
password='<ssh-pwd>')
229+
# If you are in US East, US West 2, or US South Central, use the following instead:
230+
# attach_config = HDInsightCompute.attach_configuration(resource_id='<resource_id>',
231+
# ssh_port=22,
232+
# username='<ssh-username>',
233+
# password='<ssh-pwd>')
219234
hdi_compute = ComputeTarget.attach(workspace=ws,
220235
name='myhdi',
221236
attach_configuration=attach_config)

0 commit comments

Comments
 (0)