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-migrate-from-v1.md
+35-13Lines changed: 35 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.subservice: core
8
8
ms.topic: how-to
9
9
author: balapv
10
10
ms.author: balapv
11
-
ms.date: 09/23/2022
11
+
ms.date: 02/22/2024
12
12
ms.reviewer: sgilley
13
13
ms.custom: devplatv2, devx-track-python
14
14
monikerRange: 'azureml-api-2 || azureml-api-1'
@@ -46,12 +46,6 @@ You should then ensure the features you need in v2 meet your organization's requ
46
46
> [!IMPORTANT]
47
47
> New features in Azure Machine Learning will only be launched in v2.
48
48
49
-
## Should I upgrade existing code to v2
50
-
51
-
You can reuse your existing assets in your v2 workflows. For instance a model created in v1 can be used to perform Managed Inferencing in v2.
52
-
53
-
Optionally, if you want to upgrade specific parts of your existing code to v2, please refer to the comparison links provided in the details of each resource or asset in the rest of this document.
54
-
55
49
## Which v2 API should I use?
56
50
57
51
In v2 interfaces via REST API, CLI, and Python SDK are available. The interface you should use depends on your scenario and preferences.
@@ -62,15 +56,24 @@ In v2 interfaces via REST API, CLI, and Python SDK are available. The interface
62
56
|CLI|Recommended for automation with CI/CD or per personal preference. Allows quick iteration with YAML files and straightforward separation between Azure Machine Learning and ML model code.|
63
57
|Python SDK|Recommended for complicated scripting (for example, programmatically generating large pipeline jobs) or per personal preference. Allows quick iteration with YAML files or development solely in Python.|
64
58
65
-
## Can I use v1 and v2 together?
59
+
## Mapping of Python SDK v1 to v2
66
60
67
-
v1 and v2 can co-exist in a workspace. You can reuse your existing assets in your v2 workflows. For instance a model created in v1 can be used to perform Managed Inferencing in v2. Resources like workspace, compute, and datastore work across v1 and v2, with exceptions. A user can call the v1 Python SDK to change a workspace's description, then using the v2 CLI extension change it again. Jobs (experiments/runs/pipelines in v1) can be submitted to the same workspace from the v1 or v2 Python SDK. A workspace can have both v1 and v2 model deployment endpoints.
61
+
See each of the following articles for a comparison code mapping for SDKv1 vs v2.
68
62
69
-
### Using v1 and v2 code together
70
-
We do not recommend using the v1 and v2 SDKs together in the same code. It is technically possible to use v1 and v2 in the same code because they use different Azure namespaces. However, there are many classes with the same name across these namespaces (like Workspace, Model) which can cause confusion and make code readability and debuggability challenging.
63
+
|Resources and assets |Article |
64
+
|---------|---------|
65
+
|Workspace |[Workspace management in SDK v1 and SDK v2](migrate-to-v2-resource-workspace.md)|
66
+
|Datastore |[Datastore management in SDK v1 and SDK v2](migrate-to-v2-resource-datastore.md)|
67
+
|Compute |[Compute management in SDK v1 and SDK v2](migrate-to-v2-resource-compute.md)|
68
+
|Training |[Run a script](migrate-to-v2-command-job.md)|
|Data |[Data assets in SDK v1 and v2](migrate-to-v2-assets-data.md)|
75
+
| Models |[Model management in SDK v1 and SDK v2](migrate-to-v2-assets-model.md)|
71
76
72
-
> [!IMPORTANT]
73
-
> If your workspace uses a private endpoint, it will automatically have the `v1_legacy_mode` flag enabled, preventing usage of v2 APIs. See [how to configure network isolation with v2](how-to-configure-network-isolation-with-v2.md?view=azureml-api-2&preserve-view=true) for details.
74
77
75
78
## Resources and assets in v1 and v2
76
79
@@ -208,6 +211,25 @@ A key paradigm with v2 is serializing machine learning entities as YAML files fo
208
211
209
212
You can obtain a YAML representation of any entity with the CLI via `az ml <entity> show --output yaml`. Note that this output will have system-generated properties, which can be ignored or deleted.
210
213
214
+
## Should I upgrade existing code to v2
215
+
216
+
You can reuse your existing assets in your v2 workflows. For instance a model created in v1 can be used to perform Managed Inferencing in v2.
217
+
218
+
Optionally, if you want to upgrade specific parts of your existing code to v2, please refer to the comparison links provided in the details of each resource or asset in the rest of this document.
219
+
220
+
## Can I use v1 and v2 together?
221
+
222
+
v1 and v2 can co-exist in a workspace. You can reuse your existing assets in your v2 workflows. For instance a model created in v1 can be used to perform Managed Inferencing in v2. Resources like workspace, compute, and datastore work across v1 and v2, with exceptions. A user can call the v1 Python SDK to change a workspace's description, then using the v2 CLI extension change it again. Jobs (experiments/runs/pipelines in v1) can be submitted to the same workspace from the v1 or v2 Python SDK. A workspace can have both v1 and v2 model deployment endpoints.
223
+
224
+
### Using v1 and v2 code together
225
+
226
+
We do not recommend using the v1 and v2 SDKs together in the same code. It is technically possible to use v1 and v2 in the same code because they use different Azure namespaces. However, there are many classes with the same name across these namespaces (like Workspace, Model) which can cause confusion and make code readability and debuggability challenging.
227
+
228
+
> [!IMPORTANT]
229
+
> If your workspace uses a private endpoint, it will automatically have the `v1_legacy_mode` flag enabled, preventing usage of v2 APIs. See [how to configure network isolation with v2](how-to-configure-network-isolation-with-v2.md?view=azureml-api-2&preserve-view=true) for details.
230
+
231
+
232
+
211
233
## Next steps
212
234
213
235
-[Get started with the CLI (v2)](how-to-configure-cli.md?view=azureml-api-2&preserve-view=true)
0 commit comments