Skip to content

Commit 04a353d

Browse files
committed
Module import moved to prerequisites, link to notebook created
1 parent 7f3a1cd commit 04a353d

File tree

1 file changed

+25
-40
lines changed

1 file changed

+25
-40
lines changed

articles/machine-learning/how-to-debug-managed-online-endpoints-visual-studio-code.md

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The following table provides an overview of scenarios to help you choose what wo
4949

5050
## Prerequisites
5151

52-
# [Portal](#tab/azure-portal)
52+
# [Azure CLI](#tab/cli)
5353

5454
This guide assumes you have the following items installed locally on your PC.
5555

@@ -96,34 +96,43 @@ This guide assumes you have the following items installed locally on your PC.
9696

9797
For more information, see the guide on [how to prepare your system to deploy managed online endpoints](how-to-deploy-managed-online-endpoints.md#prepare-your-system).
9898

99-
The examples in this article are based on code samples contained in the [azureml-examples](https://github.com/azure/azureml-examples) repository. To run the commands locally without having to copy/paste YAML and other files, clone the repo and then change directories to the `cli` directory in the repo:
99+
The examples in this article can be found in the [Debug online endpoints locally in Visual Studio Code](https://github.com/Azure/azureml-examples/blob/main/sdk/endpoints/online/managed/debug-online-endpoints-locally-in-visual-studio-code.ipynb) notebook within the[azureml-examples](https://github.com/azure/azureml-examples) repository. To run the code locally, clone the repo and then change directories to the notebook's parent directory `sdk/endpoints/online/managed`.
100100

101101
```azurecli
102102
git clone https://github.com/Azure/azureml-examples --depth 1
103103
cd azureml-examples
104104
cd cli
105105
```
106106

107-
If you haven't already set the defaults for the Azure CLI, save your default settings. To avoid passing in the values for your subscription, workspace, and resource group multiple times, use the following commands. Replace the following parameters with values for your specific configuration:
107+
Import the required modules:
108108

109-
* Replace `<subscription>` with your Azure subscription ID.
110-
* Replace `<workspace>` with your Azure Machine Learning workspace name.
111-
* Replace `<resource-group>` with the Azure resource group that contains your workspace.
112-
* Replace `<location>` with the Azure region that contains your workspace.
109+
```python
110+
from azure.ai.ml import MLClient
111+
from azure.ai.ml.entities import (
112+
ManagedOnlineEndpoint,
113+
ManagedOnlineDeployment,
114+
Model,
115+
CodeConfiguration,
116+
Environment,
117+
)
118+
from azure.identity import DefaultAzureCredential, AzureCliCredential
119+
```
113120

114-
> [!TIP]
115-
> You can see what your current defaults are by using the `az configure -l` command.
121+
Set up variables for the workspace and endpoint:
116122

117-
```azurecli
118-
az account set --subscription <subscription>
119-
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
120-
```
123+
```python
124+
subscription_id = "<SUBSCRIPTION_ID>"
125+
resource_group = "<RESOURCE_GROUP>"
126+
workspace_name = "<AML_WORKSPACE_NAME>"
127+
128+
endpoint_name = "<ENDPOINT_NAME>"
129+
```
121130

122131
---
123132

124133
## Launch development container
125134

126-
# [Portal](#tab/azure-portal)
135+
# [Azure CLI](#tab/cli)
127136

128137
Azure Machine Learning local endpoints use Docker and VS Code development containers (dev container) to build and configure a local debugging environment. With dev containers, you can take advantage of VS Code features from inside a Docker container. For more information on dev containers, see [Create a development container](https://code.visualstudio.com/docs/remote/create-dev-container).
129138

@@ -158,30 +167,6 @@ You'll use a few VS Code extensions to debug your deployments in the dev contain
158167

159168
Azure Machine Learning local endpoints use Docker and VS Code development containers (dev container) to build and configure a local debugging environment. With dev containers, you can take advantage of VS Code features from inside a Docker container. For more information on dev containers, see [Create a development container](https://code.visualstudio.com/docs/remote/create-dev-container).
160169

161-
Import the required modules:
162-
163-
```python
164-
from azure.ai.ml import MLClient
165-
from azure.ai.ml.entities import (
166-
ManagedOnlineEndpoint,
167-
ManagedOnlineDeployment,
168-
Model,
169-
CodeConfiguration,
170-
Environment,
171-
)
172-
from azure.identity import DefaultAzureCredential, AzureCliCredential
173-
```
174-
175-
Set up variables for the workspace and endpoint:
176-
177-
```python
178-
subscription_id = "<SUBSCRIPTION_ID>"
179-
resource_group = "<RESOURCE_GROUP>"
180-
workspace_name = "<AML_WORKSPACE_NAME>"
181-
182-
endpoint_name = "<ENDPOINT_NAME>"
183-
```
184-
185170
Get a handle to the workspace:
186171

187172
```python
@@ -277,7 +262,7 @@ For more information on the VS Code debugger, see [Debugging in VS Code](https:/
277262

278263
## Debug your endpoint
279264

280-
# [Portal](#tab/azure-portal)
265+
# [Azure CLI](#tab/cli)
281266

282267
Now that your application is running in the debugger, try making a prediction to debug your scoring script.
283268

@@ -381,7 +366,7 @@ At this point, any breakpoints in your `run` function are caught. Use the debug
381366
382367
## Edit your endpoint
383368
384-
# [Portal](#tab/azure-portal)
369+
# [Azure CLI](#tab/cli)
385370
386371
As you debug and troubleshoot your application, there are scenarios where you need to update your scoring script and configurations.
387372

0 commit comments

Comments
 (0)