Skip to content

Commit f3558fa

Browse files
authored
resource id updates for HDI and VM
1 parent 092cdc5 commit f3558fa

File tree

1 file changed

+9
-35
lines changed

1 file changed

+9
-35
lines changed

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

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -146,32 +146,19 @@ Use the Azure Data Science Virtual Machine (DSVM) as the Azure VM of choice for
146146
> [!WARNING]
147147
> Azure Machine Learning only supports virtual machines that run Ubuntu. When you create a VM or choose an existing VM, you must select a VM that uses Ubuntu.
148148
149-
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.
150-
151-
> [!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 with the `resource_id` parameter:
153-
>
154-
> * US East
155-
> * US West 2
156-
> * 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-
149+
1. **Attach**: To attach an existing virtual machine as a compute target, you must provide the resource ID, user name, and password for the virtual machine. 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>`
160150

151+
161152
```python
162153
from azureml.core.compute import RemoteCompute, ComputeTarget
163154

164155
# Create the compute config
165156
compute_target_name = "attach-dsvm"
166-
attach_config = RemoteCompute.attach_configuration(address='<fqdn>',
167-
ssh_port=22,
168-
username='<username>',
169-
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>")
157+
158+
attach_config = RemoteCompute.attach_configuration(resource_id='<resource_id>',
159+
ssh_port=22,
160+
username='<username>',
161+
password="<password>")
175162

176163
# If you authenticate with SSH keys instead, use this code:
177164
# ssh_port=22,
@@ -205,28 +192,15 @@ Azure HDInsight is a popular platform for big-data analytics. The platform provi
205192

206193
After the cluster is created, connect to it with the hostname \<clustername>-ssh.azurehdinsight.net, where \<clustername> is the name that you provided for the cluster.
207194

208-
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.
209-
210-
> [!IMPORTANT]
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:
212-
>
213-
> * US East
214-
> * US West 2
215-
> * 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>`.
195+
1. **Attach**: To attach an HDInsight cluster as a compute target, you must provide the resource ID, user name, and password for the HDInsight cluster. The resource ID of the HDInsight cluster can be constructed using the subscription ID, resource group name, and HDInsight cluster name using the following string format: `/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.HDInsight/clusters/<cluster_name>`
218196

219197
```python
220198
from azureml.core.compute import ComputeTarget, HDInsightCompute
221199
from azureml.exceptions import ComputeTargetException
222200

223201
try:
224202
# if you want to connect using SSH key instead of username/password you can provide parameters private_key_file and private_key_passphrase
225-
attach_config = HDInsightCompute.attach_configuration(address='<clustername>-ssh.azurehdinsight.net',
226-
ssh_port=22,
227-
username='<ssh-username>',
228-
password='<ssh-pwd>')
229-
# If you are in US East, US West 2, or US South Central, use the following instead:
203+
230204
# attach_config = HDInsightCompute.attach_configuration(resource_id='<resource_id>',
231205
# ssh_port=22,
232206
# username='<ssh-username>',

0 commit comments

Comments
 (0)