Skip to content

Commit ec9f096

Browse files
Merge pull request #279605 from sdgilley/sdg-freshness
freshness compute instance
2 parents fef3400 + b0e7de6 commit ec9f096

File tree

4 files changed

+51
-47
lines changed

4 files changed

+51
-47
lines changed

articles/machine-learning/how-to-create-compute-instance.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ ms.service: machine-learning
77
ms.subservice: compute
88
ms.custom: devx-track-azurecli
99
ms.topic: how-to
10-
author: jesscioffi
11-
ms.author: jcioffi
10+
ms.author: vijetaj
11+
author: vijetajo
1212
ms.reviewer: sgilley
13-
ms.date: 05/03/2024
13+
ms.date: 06/10/2024
1414
---
1515

1616
# Create an Azure Machine Learning compute instance
@@ -40,11 +40,14 @@ Choose the tab for the environment you're using for other prerequisites.
4040

4141
* To use the Python SDK, [set up your development environment with a workspace](how-to-configure-environment.md). Once your environment is set up, attach to the workspace in your Python script:
4242

43-
[!INCLUDE [connect ws v2](includes/machine-learning-connect-ws-v2.md)]
43+
[!INCLUDE [connect ws v2](includes/machine-learning-connect-ws-v2.md)]
4444

4545
# [Azure CLI](#tab/azure-cli)
4646

47-
* To use the CLI, install the [Azure CLI extension for Machine Learning service (v2)](https://aka.ms/sdk-v2-install), [Azure Machine Learning Python SDK (v2)](https://aka.ms/sdk-v2-install), or the [Azure Machine Learning Visual Studio Code extension](how-to-setup-vs-code.md).
47+
* If you're working on a compute instance, the CLI is already installed. If working on a different computer, install the [Azure CLI extension for Machine Learning service (v2)](https://aka.ms/sdk-v2-install).
48+
49+
[!INCLUDE [set-up-cli](includes/set-up-cli.md)]
50+
4851

4952
# [Studio](#tab/azure-studio)
5053

@@ -123,7 +126,6 @@ Where the file *create-instance.yml* is:
123126
* If you're using an __Azure Virtual Network__, specify the **Resource group**, **Virtual network**, and **Subnet** to create the compute instance inside an Azure Virtual Network. You can also select __No public IP__ to prevent the creation of a public IP address, which requires a private link workspace. You must also satisfy these [network requirements](./how-to-secure-training-vnet.md) for virtual network setup.
124127

125128
* If you're using an Azure Machine Learning __managed virtual network__, the compute instance is created inside the managed virtual network. You can also select __No public IP__ to prevent the creation of a public IP address. For more information, see [managed compute with a managed network](./how-to-managed-network-compute.md).
126-
* Allow root access. (preview)
127129

128130
1. Select **Applications** if you want to add custom applications to use on your compute instance, such as RStudio or Posit Workbench. See [Add custom applications such as RStudio or Posit Workbench](#add-custom-applications-such-as-rstudio-or-posit-workbench).
129131
1. Select **Tags** if you want to add additional information to categorize the compute instance.
@@ -248,17 +250,6 @@ from azure.ai.ml.constants import TimeZone
248250
from azure.ai.ml import MLClient
249251
from azure.identity import DefaultAzureCredential
250252
251-
# authenticate
252-
credential = DefaultAzureCredential()
253-
254-
# Get a handle to the workspace
255-
ml_client = MLClient(
256-
credential=credential,
257-
subscription_id="<SUBSCRIPTION_ID>",
258-
resource_group_name="<RESOURCE_GROUP>",
259-
workspace_name="<AML_WORKSPACE_NAME>",
260-
)
261-
262253
ci_minimal_name = "ci-name"
263254
ci_start_time = "2023-06-21T11:47:00" #specify your start time in the format yyyy-mm-ddThh:mm:ss
264255
@@ -453,8 +444,7 @@ from azure.ai.ml import MLClient
453444
from azure.identity import ManagedIdentityCredential
454445
client_id = os.environ.get("DEFAULT_IDENTITY_CLIENT_ID", None)
455446
credential = ManagedIdentityCredential(client_id=client_id)
456-
ml_client = MLClient(credential, sub_id, rg_name, ws_name)
457-
data = ml_client.data.get(name=data_name, version="1")
447+
ml_client = MLClient(credential, subscription_id, resource_group, workspace)
458448
```
459449

460450
You can also use SDK V1:
@@ -464,7 +454,7 @@ from azureml.core.authentication import MsiAuthentication
464454
from azureml.core import Workspace
465455
client_id = os.environ.get("DEFAULT_IDENTITY_CLIENT_ID", None)
466456
auth = MsiAuthentication(identity_config={"client_id": client_id})
467-
workspace = Workspace.get("chrjia-eastus", auth=auth, subscription_id="381b38e9-9840-4719-a5a0-61d9585e1e91", resource_group="chrjia-rg", location="East US")
457+
workspace = Workspace.get("chrjia-eastus", auth=auth, subscription_id=subscription_id, resource_group=resource_group, location="East US")
468458
```
469459

470460
# [Azure CLI](#tab/azure-cli)

articles/machine-learning/how-to-manage-compute-instance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ms.service: machine-learning
77
ms.subservice: compute
88
ms.custom: devx-track-azurecli
99
ms.topic: how-to
10-
author: jesscioffi
11-
ms.author: jcioffi
10+
ms.author: vijetaj
11+
author: vijetajo
1212
ms.reviewer: sgilley
1313
ms.date: 05/03/2024
1414
---

articles/machine-learning/how-to-r-deploy-r-model.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -181,33 +181,11 @@ These steps assume you have an Azure Container Registry associated with your wor
181181
1. If you see custom environments, nothing more is needed.
182182
1. If you don't see any custom environments, create [an R environment](how-to-r-modify-script-for-production.md#create-an-environment), or any other custom environment. (You *won't* use this environment for deployment, but you *will* use the container registry that is also created for you.)
183183

184-
Once you have verified that you have at least one custom environment, use the following steps to build a container.
184+
Once you have verified that you have at least one custom environment, start a terminal and set up the CLI:
185185

186-
1. Open a terminal window and sign in to Azure. If you're doing this from an [Azure Machine Learning compute instance](quickstart-create-resources.md#create-a-compute-instance), use:
186+
[!INCLUDE [set-up-cli](includes/set-up-cli.md)]
187187

188-
```azurecli
189-
az login --identity
190-
```
191-
192-
If you're not on the compute instance, omit `--identity` and follow the prompt to open a browser window to authenticate.
193-
194-
1. Make sure you have the most recent versions of the CLI and the `ml` extension:
195-
196-
```azurecli
197-
az upgrade
198-
```
199-
200-
1. If you have multiple Azure subscriptions, set the active subscription to the one you're using for your workspace. (You can skip this step if you only have access to a single subscription.) Replace `<SUBSCRIPTION-NAME>` with your subscription name. Also remove the brackets `<>`.
201-
202-
```azurecli
203-
az account set --subscription "<SUBSCRIPTION-NAME>"
204-
```
205-
206-
1. Set the default workspace. If you're doing this from a compute instance, you can use the following command as is. If you're on any other computer, substitute your resource group and workspace name instead. (You can find these values in [Azure Machine Learning studio](how-to-r-train-model.md#submit-the-job).)
207-
208-
```azurecli
209-
az configure --defaults group=$CI_RESOURCE_GROUP workspace=$CI_WORKSPACE
210-
```
188+
After you've set up the CLI, use the following steps to build a container.
211189

212190
1. Make sure you are in your project directory.
213191

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: "Include file"
3+
description: "Include file"
4+
services: machine-learning
5+
author: sdgilley
6+
ms.service: machine-learning
7+
ms.author: sgilley
8+
ms.custom: "include file"
9+
ms.topic: "include"
10+
ms.date: 06/10/2024
11+
---
12+
13+
1. Open a terminal window and sign in to Azure. If you're using an [Azure Machine Learning compute instance](../quickstart-create-resources.md#create-a-compute-instance), use:
14+
15+
```azurecli
16+
az login --identity
17+
```
18+
19+
If you're not on the compute instance, omit `--identity` and follow the prompt to open a browser window to authenticate.
20+
21+
1. Make sure you have the most recent versions of the CLI and the `ml` extension:
22+
23+
```azurecli
24+
az upgrade
25+
```
26+
27+
1. If you have multiple Azure subscriptions, set the active subscription to the one you're using for your workspace. (You can skip this step if you only have access to a single subscription.) Replace `<YOUR_SUBSCRIPTION_NAME_OR_ID>` with either your subscription name or subscription ID. Also remove the brackets `<>`.
28+
29+
:::code language="azurecli" source="~/azureml-examples-main/cli/misc.sh" id="az_account_set":::
30+
31+
32+
1. Set the default workspace. If you're using a compute instance, you can keep the following command as is. If you're on any other computer, substitute your resource group and workspace name instead. (You can find these values in [Azure Machine Learning studio](../how-to-r-train-model.md#submit-the-job).)
33+
34+
```azurecli
35+
az configure --defaults group=$CI_RESOURCE_GROUP workspace=$CI_WORKSPACE
36+
```

0 commit comments

Comments
 (0)