Skip to content

Commit 1f3c085

Browse files
authored
Merge pull request #206224 from Blackmist/rest-version
api version
2 parents b5ccc11 + 59717ed commit 1f3c085

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: larryfr
77
services: machine-learning
88
ms.service: machine-learning
99
ms.subservice: core
10-
ms.date: 08/10/2020
10+
ms.date: 07/28/2022
1111
ms.topic: how-to
1212
ms.custom: devx-track-python
1313
---
@@ -85,10 +85,15 @@ curl -h "Authorization:Bearer <YOUR-ACCESS-TOKEN>" ...more args...
8585
To retrieve the list of resource groups associated with your subscription, run:
8686

8787
```bash
88-
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups?api-version=2021-03-01-preview -H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
88+
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups?api-version=2021-04-01 -H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
8989
```
9090

91-
Across Azure, many REST APIs are published. Each service provider updates their API on their own cadence, but does so without breaking existing programs. The service provider uses the `api-version` argument to ensure compatibility. The `api-version` argument varies from service to service. For the Machine Learning Service, for instance, the current API version is `2021-03-01-preview`. For storage accounts, it's `2019-08-01`. For key vaults, it's `2019-09-01`. All REST calls should set the `api-version` argument to the expected value. You can rely on the syntax and semantics of the specified version even as the API continues to evolve. If you send a request to a provider without the `api-version` argument, the response will contain a human-readable list of supported values.
91+
Across Azure, many REST APIs are published. Each service provider updates their API on their own cadence, but does so without breaking existing programs. The service provider uses the `api-version` argument to ensure compatibility.
92+
93+
> [!IMPORTANT]
94+
> The `api-version` argument varies from service to service. For the Machine Learning Service, for instance, the current API version is `2022-05-01`. To find the latest API version for other Azure services, see the [Azure REST API reference](/rest/api/azure/) for the specific service.
95+
96+
All REST calls should set the `api-version` argument to the expected value. You can rely on the syntax and semantics of the specified version even as the API continues to evolve. If you send a request to a provider without the `api-version` argument, the response will contain a human-readable list of supported values.
9297

9398
The above call will result in a compacted JSON response of the form:
9499

@@ -123,7 +128,7 @@ The above call will result in a compacted JSON response of the form:
123128
To retrieve the set of workspaces in a resource group, run the following, replacing `<YOUR-SUBSCRIPTION-ID>`, `<YOUR-RESOURCE-GROUP>`, and `<YOUR-ACCESS-TOKEN>`:
124129

125130
```
126-
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/?api-version=2021-03-01-preview \
131+
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/?api-version=2022-05-01 \
127132
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
128133
```
129134

@@ -184,15 +189,15 @@ The value of the `api` response is the URL of the server that you'll use for mor
184189

185190
```bash
186191
curl https://<REGIONAL-API-SERVER>/history/v1.0/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
187-
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/experiments?api-version=2021-03-01-preview \
192+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/experiments?api-version=2022-05-01 \
188193
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
189194
```
190195

191196
Similarly, to retrieve registered models in your workspace, send:
192197

193198
```bash
194199
curl https://<REGIONAL-API-SERVER>/modelmanagement/v1.0/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
195-
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/models?api-version=2021-03-01-preview \
200+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/models?api-version=2022-05-01 \
196201
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
197202
```
198203

@@ -228,15 +233,15 @@ Training and running ML models require compute resources. You can list the compu
228233

229234
```bash
230235
curl https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/\
231-
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/computes?api-version=2021-03-01-preview \
236+
providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/computes?api-version=2022-05-01 \
232237
-H "Authorization:Bearer <YOUR-ACCESS-TOKEN>"
233238
```
234239

235240
To create or overwrite a named compute resource, you'll use a PUT request. In the following, in addition to the now-familiar replacements of `YOUR-SUBSCRIPTION-ID`, `YOUR-RESOURCE-GROUP`, `YOUR-WORKSPACE-NAME`, and `YOUR-ACCESS-TOKEN`, replace `YOUR-COMPUTE-NAME`, and values for `location`, `vmSize`, `vmPriority`, `scaleSettings`, `adminUserName`, and `adminUserPassword`. As specified in the reference at [Machine Learning Compute - Create Or Update SDK Reference](/rest/api/azureml/2022-05-01/workspaces/create-or-update), the following command creates a dedicated, single-node Standard_D1 (a basic CPU compute resource) that will scale down after 30 minutes:
236241

237242
```bash
238243
curl -X PUT \
239-
'https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/computes/<YOUR-COMPUTE-NAME>?api-version=2021-03-01-preview' \
244+
'https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/computes/<YOUR-COMPUTE-NAME>?api-version=2022-05-01' \
240245
-H 'Authorization:Bearer <YOUR-ACCESS-TOKEN>' \
241246
-H 'Content-Type: application/json' \
242247
-d '{
@@ -274,7 +279,7 @@ To create a workspace, PUT a call similar to the following to `management.azure.
274279
```bash
275280
curl -X PUT \
276281
'https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>\
277-
/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-NEW-WORKSPACE-NAME>?api-version=2021-03-01-preview' \
282+
/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-NEW-WORKSPACE-NAME>?api-version=2022-05-01' \
278283
-H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
279284
-H 'Content-Type: application/json' \
280285
-d '{
@@ -306,7 +311,7 @@ When creating workspace, you can specify a user-assigned managed identity that w
306311
```bash
307312
curl -X PUT \
308313
'https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>\
309-
/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-NEW-WORKSPACE-NAME>?api-version=2021-03-01-preview' \
314+
/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-NEW-WORKSPACE-NAME>?api-version=2022-05-01' \
310315
-H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
311316
-H 'Content-Type: application/json' \
312317
-d '{
@@ -350,7 +355,7 @@ To create a workspaces that uses a user-assigned managed identity and customer-m
350355
```bash
351356
curl -X PUT \
352357
'https://management.azure.com/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>\
353-
/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-NEW-WORKSPACE-NAME>?api-version=2021-03-01-preview' \
358+
/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-NEW-WORKSPACE-NAME>?api-version=2022-05-01' \
354359
-H 'Authorization: Bearer <YOUR-ACCESS-TOKEN>' \
355360
-H 'Content-Type: application/json' \
356361
-d '{
@@ -393,7 +398,7 @@ Some, but not all, resources support the DELETE verb. Check the [API Reference](
393398
```bash
394399
curl
395400
-X DELETE \
396-
'https://<REGIONAL-API-SERVER>/modelmanagement/v1.0/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/models/<YOUR-MODEL-ID>?api-version=2021-03-01-preview' \
401+
'https://<REGIONAL-API-SERVER>/modelmanagement/v1.0/subscriptions/<YOUR-SUBSCRIPTION-ID>/resourceGroups/<YOUR-RESOURCE-GROUP>/providers/Microsoft.MachineLearningServices/workspaces/<YOUR-WORKSPACE-NAME>/models/<YOUR-MODEL-ID>?api-version=2022-05-01' \
397402
-H 'Authorization:Bearer <YOUR-ACCESS-TOKEN>'
398403
```
399404

articles/machine-learning/how-to-train-with-rest.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.subservice: core
88
ms.topic: how-to
99
author: singankit
1010
ms.author: anksing
11-
ms.date: 03/31/2022
11+
ms.date: 07/28/2022
1212
ms.reviewer: nibaccam
1313
ms.custom: devplatv2, event-tier1-build-2022
1414
---
@@ -57,11 +57,9 @@ Administrative REST requests a [service principal authentication token](how-to-m
5757
TOKEN=$(az account get-access-token --query accessToken -o tsv)
5858
```
5959

60-
The service provider uses the `api-version` argument to ensure compatibility. The `api-version` argument varies from service to service. The current Azure Machine Learning API version is `2022-02-01-preview`. Set the API version as a variable to accommodate future versions:
60+
The service provider uses the `api-version` argument to ensure compatibility. The `api-version` argument varies from service to service. Set the API version as a variable to accommodate future versions:
6161

62-
```bash
63-
API_VERSION="2022-02-01-preview"
64-
```
62+
:::code language="rest-api" source="~/azureml-examples-main/cli/deploy-rest.sh" id="api_version":::
6563

6664
### Compute
6765

0 commit comments

Comments
 (0)