Skip to content

Commit 0fc7b48

Browse files
authored
Added Auth info
1 parent 2719908 commit 0fc7b48

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

articles/machine-learning/how-to-manage-models.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ Azure Machine Learning allows you to work with different types of models. In thi
2929
* The Azure Machine Learning [SDK v2 for Python](https://aka.ms/sdk-v2-install).
3030
* The Azure Machine Learning [CLI v2](how-to-configure-cli.md).
3131

32+
Additionally, you will need to:
33+
34+
# [Azure CLI](#tab/cli)
35+
36+
- Install the Azure CLI and the ml extension to the Azure CLI. For more information, see [Install, set up, and use the CLI (v2)](how-to-configure-cli.md).
37+
38+
# [Python (Azure ML SDK)](#tab/sdk)
39+
40+
- Install the Azure Machine Learning SDK for Python
41+
42+
```bash
43+
pip install azure-ai-ml
44+
```
45+
46+
# [Studio](#tab/studio)
47+
48+
There are no additional prerequisites when working in Azure Machine Learning studio.
49+
50+
---
51+
3252
## Supported paths
3353

3454
When you provide a model you want to register, you'll need to specify a `path` parameter that points to the data or job location. Below is a table that shows the different data locations supported in Azure Machine Learning and examples for the `path` parameter:
@@ -76,6 +96,46 @@ These snippets use `custom` and `mlflow`.
7696
- `custom` is a type that refers to a model file or folder trained with a custom standard not currently supported by Azure ML.
7797
- `mlflow` is a type that refers to a model trained with [mlflow](how-to-use-mlflow-cli-runs.md). MLflow trained models are in a folder that contains the *MLmodel* file, the *model* file, the *conda dependencies* file, and the *requirements.txt* file.
7898
99+
### Connect to your workspace
100+
101+
First, let's connect to Azure Machine Learning workspace where we are going to work on.
102+
103+
# [Azure CLI](#tab/cli)
104+
105+
```azurecli
106+
az account set --subscription <subscription>
107+
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
108+
```
109+
110+
# [Python (Azure ML SDK)](#tab/sdk)
111+
112+
The workspace is the top-level resource for Azure Machine Learning, providing a centralized place to work with all the artifacts you create when you use Azure Machine Learning. In this section, we'll connect to the workspace in which you'll perform deployment tasks.
113+
114+
1. Import the required libraries:
115+
116+
```python
117+
from azure.ai.ml import MLClient, Input
118+
from azure.ai.ml.entities import Model
119+
from azure.ai.ml.constants import AssetTypes
120+
from azure.identity import DefaultAzureCredential
121+
```
122+
123+
2. Configure workspace details and get a handle to the workspace:
124+
125+
```python
126+
subscription_id = "<SUBSCRIPTION_ID>"
127+
resource_group = "<RESOURCE_GROUP>"
128+
workspace = "<AML_WORKSPACE_NAME>"
129+
130+
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
131+
```
132+
133+
# [Studio](#tab/studio)
134+
135+
Navigate to [Azure Machine Learning studio](https://ml.azure.com).
136+
137+
---
138+
79139
### Register your model as an asset in Machine Learning by using the CLI
80140
81141
Use the following tabs to select where your model is located.

0 commit comments

Comments
 (0)