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/how-to-debug-managed-online-endpoints-visual-studio-code.md
+25-40Lines changed: 25 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ The following table provides an overview of scenarios to help you choose what wo
49
49
50
50
## Prerequisites
51
51
52
-
# [Portal](#tab/azure-portal)
52
+
# [Azure CLI](#tab/cli)
53
53
54
54
This guide assumes you have the following items installed locally on your PC.
55
55
@@ -96,34 +96,43 @@ This guide assumes you have the following items installed locally on your PC.
96
96
97
97
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).
98
98
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`.
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:
108
108
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
+
```
113
120
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:
116
122
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
+
```
121
130
122
131
---
123
132
124
133
## Launch development container
125
134
126
-
# [Portal](#tab/azure-portal)
135
+
# [Azure CLI](#tab/cli)
127
136
128
137
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).
129
138
@@ -158,30 +167,6 @@ You'll use a few VS Code extensions to debug your deployments in the dev contain
158
167
159
168
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).
160
169
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
-
185
170
Get a handle to the workspace:
186
171
187
172
```python
@@ -277,7 +262,7 @@ For more information on the VS Code debugger, see [Debugging in VS Code](https:/
277
262
278
263
## Debug your endpoint
279
264
280
-
# [Portal](#tab/azure-portal)
265
+
# [Azure CLI](#tab/cli)
281
266
282
267
Now that your application is running in the debugger, try making a prediction to debug your scoring script.
283
268
@@ -381,7 +366,7 @@ At this point, any breakpoints in your `run` function are caught. Use the debug
381
366
382
367
## Edit your endpoint
383
368
384
-
# [Portal](#tab/azure-portal)
369
+
# [Azure CLI](#tab/cli)
385
370
386
371
As you debug and troubleshoot your application, there are scenarios where you need to update your scoring script and configurations.
0 commit comments