Skip to content

Commit 0714184

Browse files
Merge pull request #226012 from AbeOmor/patch-70
Added Auth info
2 parents a71127f + 23e9a9a commit 0714184

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ 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 SDK](#tab/python)
39+
40+
- Install the Azure Machine Learning SDK for Python
41+
42+
```bash
43+
pip install azure-ai-ml
44+
```
45+
---
46+
3247
## Supported paths
3348

3449
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 +91,42 @@ These snippets use `custom` and `mlflow`.
7691
- `custom` is a type that refers to a model file or folder trained with a custom standard not currently supported by Azure ML.
7792
- `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.
7893
94+
### Connect to your workspace
95+
96+
First, let's connect to Azure Machine Learning workspace where we are going to work on.
97+
98+
# [Azure CLI](#tab/cli)
99+
100+
```azurecli
101+
az account set --subscription <subscription>
102+
az configure --defaults workspace=<workspace> group=<resource-group> location=<location>
103+
```
104+
105+
# [Python SDK](#tab/python)
106+
107+
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.
108+
109+
1. Import the required libraries:
110+
111+
```python
112+
from azure.ai.ml import MLClient, Input
113+
from azure.ai.ml.entities import Model
114+
from azure.ai.ml.constants import AssetTypes
115+
from azure.identity import DefaultAzureCredential
116+
```
117+
118+
2. Configure workspace details and get a handle to the workspace:
119+
120+
```python
121+
subscription_id = "<SUBSCRIPTION_ID>"
122+
resource_group = "<RESOURCE_GROUP>"
123+
workspace = "<AML_WORKSPACE_NAME>"
124+
125+
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
126+
```
127+
128+
---
129+
79130
### Register your model as an asset in Machine Learning by using the CLI
80131
81132
Use the following tabs to select where your model is located.

0 commit comments

Comments
 (0)