Skip to content

Commit 395c01e

Browse files
authored
Merge pull request #235265 from Blackmist/registry-updates-0420
Registry updates 0420
2 parents 0b70431 + dbb70e5 commit 395c01e

File tree

1 file changed

+79
-9
lines changed

1 file changed

+79
-9
lines changed

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

Lines changed: 79 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
title: Create and manage registries (preview)
33
titleSuffix: Azure Machine Learning
4-
description: Learn how create registries with the CLI, Azure portal and Azure Machine Learning Studio
4+
description: Learn how create registries with the CLI, REST API, Azure portal and Azure Machine Learning studio
55
services: machine-learning
66
ms.service: machine-learning
77
ms.subservice: mlops
8-
ms.author: mabables
9-
author: ManojBableshwar
8+
ms.author: kritifaujdar
9+
author: fkriti
1010
ms.reviewer: larryfr
11-
ms.date: 09/21/2022
11+
ms.date: 04/12/2023
1212
ms.topic: how-to
1313
ms.custom: devx-track-python, ignite-2022
1414
---
@@ -22,7 +22,7 @@ Azure Machine Learning entities can be grouped into two broad categories:
2222

2323
Assets lend themselves to being stored in a central repository and used in different workspaces, possibly in different regions. Resources are workspace specific.
2424

25-
Azure Machine Learning registries (preview) enable you to create and use those assets in different workspaces. Registries support multi-region replication for low latency access to assets, so you can use assets in workspaces located in different Azure regions. Creating a registry will provision Azure resources required to facilitate replication. First, Azure blob storage accounts in each supported region. Second, a single Azure Container Registry with replication enabled to each supported region.
25+
Azure Machine Learning registries (preview) enable you to create and use those assets in different workspaces. Registries support multi-region replication for low latency access to assets, so you can use assets in workspaces located in different Azure regions. Creating a registry provisions Azure resources required to facilitate replication. First, Azure blob storage accounts in each supported region. Second, a single Azure Container Registry with replication enabled to each supported region.
2626

2727
:::image type="content" source="./media/how-to-manage-registries/machine-learning-registry-block-diagram.png" alt-text="Diagram of the relationships between assets in workspace and registry.":::
2828

@@ -68,8 +68,8 @@ Create the YAML definition and name it `registry.yml`.
6868
6969
```YAML
7070
name: DemoRegistry1
71-
description: Basic registry with one primary region and to additional regions
7271
tags:
72+
description: Basic registry with one primary region and to additional regions
7373
foo: bar
7474
location: eastus
7575
replication_locations:
@@ -120,8 +120,79 @@ You can create registries in Azure Machine Learning studio using the following s
120120

121121
1. Review the information and select __Create__.
122122

123+
124+
125+
# [REST API](#tab/rest)
126+
127+
> [!TIP]
128+
> You need the **curl** utility to complete this step. The **curl** program is available in the [Windows Subsystem for Linux](/windows/wsl/install-win10) or any UNIX distribution. In PowerShell, **curl** is an alias for **Invoke-WebRequest** and `curl -d "key=val" -X POST uri` becomes `Invoke-WebRequest -Body "key=val" -Method POST -Uri uri`.
129+
130+
To authenticate REST API calls, you need an authentication token for your Azure user account. You can use the following command to retrieve a token:
131+
132+
```azurecli
133+
az account get-access-token
134+
```
135+
136+
The response should provide an access token good for one hour. Make note of the token, as you use it to authenticate all administrative requests. The following JSON is a sample response:
137+
138+
> [!TIP]
139+
> The value of the `access_token` field is the token.
140+
141+
```json
142+
{
143+
"access_token": "YOUR-ACCESS-TOKEN",
144+
"expiresOn": "<expiration-time>",
145+
"subscription": "<subscription-id>",
146+
"tenant": "your-tenant-id",
147+
"tokenType": "Bearer"
148+
}
149+
```
150+
151+
To create a registry, use the following command. You can edit the JSON to change the inputs as needed. Replace the `<YOUR-ACCESS-TOKEN>` value with the access token retrieved previously:
152+
153+
```bash
154+
curl -X PUT https://management.azure.com/subscriptions/<your-subscription-id>/resourceGroups/<your-resource-group>/providers/Microsoft.MachineLearningServices/registries/reg-from-rest?api-version=2022-12-01-preview -H "Authorization:Bearer <YOUR-ACCESS-TOKEN>" -H 'Content-Type: application/json' -d '
155+
{
156+
"properties":
157+
{
158+
"regionDetails":
159+
[
160+
{
161+
"location": "eastus",
162+
"storageAccountDetails":
163+
[
164+
{
165+
"systemCreatedStorageAccount":
166+
{
167+
"storageAccountType": "Standard_LRS"
168+
}
169+
}
170+
],
171+
"acrDetails":
172+
[
173+
{
174+
"systemCreatedAcrAccount":
175+
{
176+
"acrAccountSku": "Premium"
177+
}
178+
}
179+
]
180+
}
181+
]
182+
},
183+
"identity": {
184+
"type": "SystemAssigned"
185+
},
186+
"location": "eastus"
187+
}
188+
'
189+
```
190+
191+
You should receive a `202 Accepted` response.
192+
123193
---
124194

195+
125196
## Specify storage account type and SKU (optional)
126197

127198
> [!TIP]
@@ -134,12 +205,12 @@ Next, decide if you want to use an [Azure Blob storage](../storage/blobs/storage
134205
> [!NOTE]
135206
>The `hns` portion of `storage_account_hns` refers to the [hierarchical namespace](../storage/blobs/data-lake-storage-namespace.md) capability of Azure Data Lake Storage Gen2 accounts.
136207

137-
Below is an example YAML that demonstrates this advanced storage configuration:
208+
The following example YAML file demonstrates this advanced storage configuration:
138209

139210
```YAML
140211
name: DemoRegistry2
141-
description: Registry with additional configuration for storage accounts
142212
tags:
213+
description: Registry with additional configuration for storage accounts
143214
foo: bar
144215
location: eastus
145216
replication_locations:
@@ -191,7 +262,6 @@ Permission | Description
191262
Microsoft.MachineLearningServices/registries/write| Allows the user to create or update registries
192263
Microsoft.MachineLearningServices/registries/delete | Allows the user to delete registries
193264

194-
---
195265

196266
## Next steps
197267

0 commit comments

Comments
 (0)