Skip to content

Commit af4ef8c

Browse files
Merge pull request #210739 from sdgilley/sdg-patch
Fix Python/CLI tabs
2 parents 2afcd51 + d881dde commit af4ef8c

7 files changed

+54
-61
lines changed

articles/machine-learning/concept-azure-machine-learning-v2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The workspace is the top-level resource for Azure Machine Learning, providing a
4040

4141
### Create a workspace
4242

43-
### [CLI](#tab/cli)
43+
### [Azure CLI](#tab/cli)
4444

4545
To create a workspace using CLI v2, use the following command:
4646

@@ -81,7 +81,7 @@ A compute is a designated compute resource where you run your job or host your e
8181
* **Inference cluster** - used to deploy trained machine learning models to Azure Kubernetes Service. You can create an Azure Kubernetes Service (AKS) cluster from your Azure ML workspace, or attach an existing AKS cluster.
8282
* **Attached compute** - You can attach your own compute resources to your workspace and use them for training and inference.
8383

84-
### [CLI](#tab/cli)
84+
### [Azure CLI](#tab/cli)
8585

8686
To create a compute using CLI v2, use the following command:
8787

@@ -126,7 +126,7 @@ Azure Machine Learning datastores securely keep the connection information to yo
126126
* Azure Data Lake
127127
* Azure Data Lake Gen2
128128

129-
### [CLI](#tab/cli)
129+
### [Azure CLI](#tab/cli)
130130

131131
To create a datastore using CLI v2, use the following command:
132132

@@ -171,7 +171,7 @@ Azure machine learning models consist of the binary file(s) that represent a mac
171171

172172
### Creating a model
173173

174-
### [CLI](#tab/cli)
174+
### [Azure CLI](#tab/cli)
175175

176176
To create a model using CLI v2, use the following command:
177177

@@ -221,7 +221,7 @@ In custom environments, you're responsible for setting up your environment and i
221221

222222
### Create an Azure ML custom environment
223223

224-
### [CLI](#tab/cli)
224+
### [Azure CLI](#tab/cli)
225225

226226
To create an environment using CLI v2, use the following command:
227227

articles/machine-learning/how-to-attach-kubernetes-to-workspace.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Otherwise, if a user-assigned managed identity is specified in Azure Machine Lea
3737
Azure Relay resource is created during the extension deployment under the same Resource Group as the Arc-enabled Kubernetes cluster.
3838

3939

40-
### [CLI](#tab/cli)
40+
### [Azure CLI](#tab/cli)
4141

4242
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
4343

@@ -61,7 +61,7 @@ Set the `--type` argument to `Kubernetes`. Use the `identity_type` argument to e
6161
> `--user-assigned-identities` is only required for `UserAssigned` managed identities. Although you can provide a list of comma-separated user managed identities, only the first one is used when you attach your cluster.
6262
>
6363
> Compute attach won't create the Kubernetes namespace automatically or validate whether the kubernetes namespace existed. You need to verify that the specified namespace exists in your cluster, otherwise, any AzureML workloads submitted to this compute will fail.
64-
### [Python](#tab/python)
64+
### [Python SDK](#tab/python)
6565

6666
[!INCLUDE [sdk v1](../../includes/machine-learning-sdk-v1.md)]
6767

articles/machine-learning/how-to-create-data-assets.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ ms.date: 05/24/2022
1717
---
1818

1919
# Create data assets
20+
[!INCLUDE [dev v2](../../includes/machine-learning-dev-v2.md)]
2021

2122
> [!div class="op_single_selector" title1="Select the version of Azure Machine Learning SDK you are using:"]
2223
> * [v1](./v1/how-to-create-register-datasets.md)
2324
> * [v2 (current version)](how-to-create-data-assets.md)
2425
25-
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
26-
[!INCLUDE [CLI v2](../../includes/machine-learning-CLI-v2.md)]
27-
2826
In this article, you learn how to create a data asset in Azure Machine Learning. By creating a data asset, you create a *reference* to the data source location, along with a copy of its metadata. Because the data remains in its existing location, you incur no extra storage cost, and don't risk the integrity of your data sources. You can create Data from datastores, Azure Storage, public URLs, and local files.
2927

3028
The benefits of creating data assets are:
@@ -66,7 +64,7 @@ When you create a data asset in Azure Machine Learning, you'll need to specify a
6664

6765
Below shows you how to create a *folder* as an asset:
6866

69-
# [CLI](#tab/CLI)
67+
# [Azure CLI](#tab/cli)
7068

7169
Create a `YAML` file (`<file-name>.yml`):
7270

@@ -90,7 +88,7 @@ Next, create the data asset using the CLI:
9088
az ml data create -f <file-name>.yml
9189
```
9290

93-
# [Python-SDK](#tab/Python-SDK)
91+
# [Python SDK](#tab/Python-SDK)
9492

9593
You can create a data asset in Azure Machine Learning using the following Python Code:
9694

@@ -123,7 +121,7 @@ ml_client.data.create_or_update(my_data)
123121

124122
Below shows you how to create a *specific file* as a data asset:
125123

126-
# [CLI](#tab/CLI)
124+
# [Azure CLI](#tab/cli)
127125

128126
Sample `YAML` file `<file-name>.yml` for data in local path is as below:
129127

@@ -146,7 +144,7 @@ path: <uri>
146144
> az ml data create -f <file-name>.yml
147145
```
148146

149-
# [Python-SDK](#tab/Python-SDK)
147+
# [Python SDK](#tab/Python-SDK)
150148
```python
151149
from azure.ai.ml.entities import Data
152150
from azure.ai.ml.constants import AssetTypes
@@ -223,7 +221,7 @@ The `uri` parameter in `mltable.load()` should be a valid path to a local or clo
223221
Below shows you how to create an `mltable` data asset. The `path` can be any of the supported path formats outlined above.
224222

225223

226-
# [CLI](#tab/CLI)
224+
# [Azure CLI](#tab/cli)
227225

228226
Create a `YAML` file (`<file-name>.yml`):
229227

@@ -252,7 +250,7 @@ Next, create the data asset using the CLI:
252250
az ml data create -f <file-name>.yml
253251
```
254252

255-
# [Python-SDK](#tab/Python-SDK)
253+
# [Python SDK](#tab/Python-SDK)
256254

257255
You can create a data asset in Azure Machine Learning using the following Python Code:
258256

articles/machine-learning/how-to-deploy-automl-endpoint.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ ms.devlang: azurecli
1616

1717
# How to deploy an AutoML model to an online endpoint
1818

19-
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
20-
21-
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
19+
[!INCLUDE [dev v2](../../includes/machine-learning-dev-v2.md)]
2220

2321
> [!IMPORTANT]
2422
> SDK v2 is currently in public preview.
@@ -96,7 +94,7 @@ To deploy using these files, you can use either the studio or the Azure CLI.
9694
1. Complete all the steps in wizard to create an online endpoint and deployment
9795

9896

99-
# [CLI](#tab/CLI)
97+
# [Azure CLI](#tab/cli)
10098

10199
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
102100

@@ -166,7 +164,7 @@ You'll need to modify this file to use the files you downloaded from the AutoML
166164
After you create a deployment, you can score it as described in [Invoke the endpoint to score data by using your model](how-to-deploy-managed-online-endpoints.md#invoke-the-endpoint-to-score-data-by-using-your-model).
167165
168166
169-
# [Python](#tab/python)
167+
# [Python SDK](#tab/python)
170168
171169
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
172170

articles/machine-learning/how-to-deploy-custom-container.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Custom container deployments can use web servers other than the default Python F
4040

4141
* To deploy locally, you must have [Docker engine](https://docs.docker.com/engine/install/) running locally. This step is **highly recommended**. It will help you debug issues.
4242

43-
# [CLI](#tab/CLI)
43+
# [Azure CLI](#tab/cli)
4444

4545
* Install and configure the Azure CLI and ML extension. For more information, see [Install, set up, and use the CLI (v2)](how-to-configure-cli.md).
4646

@@ -51,7 +51,7 @@ Custom container deployments can use web servers other than the default Python F
5151
az configure --defaults workspace=<azureml workspace name> group=<resource group>
5252
```
5353

54-
# [Python](#tab/python)
54+
# [Python SDK](#tab/python)
5555

5656
* If you haven't installed Python SDK v2, please install with this command:
5757

@@ -67,14 +67,14 @@ Custom container deployments can use web servers other than the default Python F
6767

6868
To follow along with this tutorial, download the source code below.
6969

70-
# [CLI](#tab/CLI)
70+
# [Azure CLI](#tab/cli)
7171

7272
```azurecli
7373
git clone https://github.com/Azure/azureml-examples --depth 1
7474
cd azureml-examples/cli
7575
```
7676

77-
# [Python](#tab/python)
77+
# [Python SDK](#tab/python)
7878

7979
```azurecli
8080
git clone https://github.com/Azure/azureml-examples --depth 1
@@ -120,7 +120,7 @@ Now that you've tested locally, stop the image:
120120
## Deploy your online endpoint to Azure
121121
Next, deploy your online endpoint to Azure.
122122

123-
# [CLI](#tab/CLI)
123+
# [Azure CLI](#tab/cli)
124124

125125
### Create a YAML file for your endpoint and deployment
126126

@@ -134,7 +134,7 @@ __tfserving-deployment.yml__
134134

135135
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/online/custom-container/tfserving-deployment.yml":::
136136

137-
# [Python](#tab/python)
137+
# [Python SDK](#tab/python)
138138

139139
### Connect to Azure Machine Learning workspace
140140
Connect to Azure Machine Learning Workspace, configure workspace details, and get a handle to the workspace as follows:
@@ -255,7 +255,7 @@ For example, if you have a directory structure of `/azureml-examples/cli/endpoin
255255

256256
:::image type="content" source="./media/how-to-deploy-custom-container/local-directory-structure.png" alt-text="Diagram showing a tree view of the local directory structure.":::
257257

258-
# [CLI](#tab/CLI)
258+
# [Azure CLI](#tab/cli)
259259

260260
and `tfserving-deployment.yml` contains:
261261

@@ -266,7 +266,7 @@ model:
266266
path: ./half_plus_two
267267
```
268268
269-
# [Python](#tab/python)
269+
# [Python SDK](#tab/python)
270270
271271
and `Model` class contains:
272272

@@ -285,7 +285,7 @@ You can optionally configure your `model_mount_path`. It enables you to change t
285285
> [!IMPORTANT]
286286
> The `model_mount_path` must be a valid absolute path in Linux (the OS of the container image).
287287

288-
# [CLI](#tab/CLI)
288+
# [Azure CLI](#tab/cli)
289289

290290
For example, you can have `model_mount_path` parameter in your _tfserving-deployment.yml_:
291291

@@ -300,7 +300,7 @@ model_mount_path: /var/tfserving-model-mount
300300
.....
301301
```
302302

303-
# [Python](#tab/python)
303+
# [Python SDK](#tab/python)
304304

305305
For example, you can have `model_mount_path` parameter in your `ManagedOnlineDeployment` class:
306306

@@ -323,7 +323,7 @@ then your model will be located at `/var/tfserving-model-mount/tfserving-deploym
323323

324324
### Create your endpoint and deployment
325325

326-
# [CLI](#tab/CLI)
326+
# [Azure CLI](#tab/cli)
327327

328328
Now that you've understood how the YAML was constructed, create your endpoint.
329329

@@ -339,7 +339,7 @@ az ml online-deployment create --name tfserving-deployment -f endpoints/online/c
339339

340340

341341

342-
# [Python](#tab/python)
342+
# [Python SDK](#tab/python)
343343

344344
Using the `MLClient` created earlier, we will now create the Endpoint in the workspace. This command will start the endpoint creation and return a confirmation response while the endpoint creation continues.
345345

@@ -359,11 +359,11 @@ ml_client.begin_create_or_update(blue_deployment)
359359

360360
Once your deployment completes, see if you can make a scoring request to the deployed endpoint.
361361

362-
# [CLI](#tab/CLI)
362+
# [Azure CLI](#tab/cli)
363363

364364
:::code language="azurecli" source="~/azureml-examples-main/cli/deploy-tfserving.sh" id="invoke_endpoint":::
365365

366-
# [Python](#tab/python)
366+
# [Python SDK](#tab/python)
367367

368368
Using the `MLClient` created earlier, we will get a handle to the endpoint. The endpoint can be invoked using the `invoke` command with the following parameters:
369369
- `endpoint_name` - Name of the endpoint
@@ -387,13 +387,13 @@ ml_client.online_endpoints.invoke(
387387

388388
Now that you've successfully scored with your endpoint, you can delete it:
389389

390-
# [CLI](#tab/CLI)
390+
# [Azure CLI](#tab/cli)
391391

392392
```azurecli
393393
az ml online-endpoint delete --name tfserving-endpoint
394394
```
395395

396-
# [Python](#tab/python)
396+
# [Python SDK](#tab/python)
397397

398398
```python
399399
ml_client.online_endpoints.begin_delete(name=online_endpoint_name)

articles/machine-learning/how-to-read-write-data-v2.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ ms.custom: devx-track-python, devplatv2, sdkv2, cliv2, event-tier1-build-2022
1616

1717
# Read and write data in a job
1818

19+
[!INCLUDE [dev v2](../../includes/machine-learning-dev-v2.md)]
20+
1921
> [!div class="op_single_selector" title1="Select the version of Azure Machine Learning CLI extension you are using:"]
2022
> * [v1](v1/how-to-train-with-datasets.md)
2123
> * [v2 (current version)](how-to-read-write-data-v2.md)
2224
23-
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
24-
[!INCLUDE [CLI v2](../../includes/machine-learning-CLI-v2.md)]
25-
2625
Learn how to read and write data for your jobs with the Azure Machine Learning Python SDK v2(preview) and the Azure Machine Learning CLI extension v2.
2726

2827
## Prerequisites
@@ -65,7 +64,7 @@ Type | Input/Output | `upload` | `download` | `ro_mount` | `rw_mount` | `direct`
6564

6665
## Read data in a job
6766

68-
# [CLI](#tab/CLI)
67+
# [Azure CLI](#tab/cli)
6968

7069
Create a job specification YAML file (`<file-name>.yml`). Specify in the `inputs` section of the job:
7170

@@ -97,7 +96,7 @@ Next, run in the CLI
9796
az ml job create -f <file-name>.yml
9897
```
9998

100-
# [Python-SDK](#tab/Python-SDK)
99+
# [Python SDK](#tab/python)
101100

102101
The `Input` class allows you to define:
103102

@@ -148,7 +147,7 @@ This section outlines how you can read V1 `FileDataset` and `TabularDataset` dat
148147

149148
#### Read a `FileDataset`
150149

151-
# [CLI](#tab/CLI)
150+
# [Azure CLI](#tab/cli)
152151

153152
Create a job specification YAML file (`<file-name>.yml`), with the type set to `mltable` and the mode set to `eval_mount`:
154153

@@ -173,7 +172,7 @@ Next, run in the CLI
173172
az ml job create -f <file-name>.yml
174173
```
175174

176-
# [Python-SDK](#tab/Python-SDK)
175+
# [Python SDK](#tab/python)
177176

178177
In the `Input` object specify the `type` as `AssetTypes.MLTABLE` and `mode` as `InputOutputModes.EVAL_MOUNT`:
179178

@@ -215,7 +214,7 @@ returned_job.services["Studio"].endpoint
215214

216215
#### Read a `TabularDataset`
217216

218-
# [CLI](#tab/CLI)
217+
# [Azure CLI](#tab/cli)
219218

220219
Create a job specification YAML file (`<file-name>.yml`), with the type set to `mltable` and the mode set to `direct`:
221220

@@ -240,7 +239,7 @@ Next, run in the CLI
240239
az ml job create -f <file-name>.yml
241240
```
242241

243-
# [Python-SDK](#tab/Python-SDK)
242+
# [Python SDK](#tab/python)
244243

245244
In the `Input` object specify the `type` as `AssetTypes.MLTABLE` and `mode` as `InputOutputModes.DIRECT`:
246245

@@ -283,7 +282,7 @@ returned_job.services["Studio"].endpoint
283282

284283
In your job you can write data to your cloud-based storage using *outputs*. The [Supported modes](#supported-modes) section showed that only job *outputs* can write data because the mode can be either `rw_mount` or `upload`.
285284

286-
# [CLI](#tab/CLI)
285+
# [Azure CLI](#tab/cli)
287286

288287
Create a job specification YAML file (`<file-name>.yml`), with the `outputs` section populated with the type and path of where you would like to write your data to:
289288

@@ -318,7 +317,7 @@ Next create a job using the CLI:
318317
az ml job create --file <file-name>.yml
319318
```
320319

321-
# [Python-SDK](#tab/Python-SDK)
320+
# [Python SDK](#tab/python)
322321

323322
```python
324323
from azure.ai.ml import command

0 commit comments

Comments
 (0)