Skip to content

Commit 2afbb71

Browse files
author
Mingwei He
committed
optimize docs for UAI workspace
1 parent c601019 commit 2afbb71

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

articles/machine-learning/how-to-identity-based-service-authentication.md

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -62,34 +62,33 @@ For automated creation of role assignments on your user-assigned managed identit
6262
> [!TIP]
6363
> For a workspace with [customer-managed keys for encryption](concept-data-encryption.md), you can pass in a user-assigned managed identity to authenticate from storage to Key Vault. Use the `user-assigned-identity-for-cmk-encryption` (CLI) or `user_assigned_identity_for_cmk_encryption` (SDK) parameters to pass in the managed identity. This managed identity can be the same or different as the workspace primary user assigned managed identity.
6464
65-
To create a workspace with user assigned identity, use one of the following methods:
65+
To create or update a workspace with user assigned identity/identities, use one of the following methods:
6666

6767
# [Azure CLI](#tab/cli)
6868

6969
[!INCLUDE [cli v2](../../includes/machine-learning-cli-v2.md)]
7070

7171
```azurecli
72-
az ml workspace create -f workspace_uai.yml
72+
az ml workspace create/update -f workspace_uai.yml --subscription <subscription ID> --resource-group <resource group name> --name <workspace name>
7373
```
7474

7575
Where the contents of *workspace_uai.yml* are as follows:
7676

7777
```yaml
78-
name: <workspace name>
7978
location: <region name>
80-
resource_group: <resource group name>
8179
identity:
8280
type: user_assigned
83-
tenant_id: <tenant ID>
8481
user_assigned_identities:
8582
'<UAI resource ID 1>': {}
8683
'<UAI resource ID 2>': {}
87-
storage_account: <storage acccount resource ID>
88-
key_vault: <key vault resource ID>
89-
image_build_compute: <compute(virtual machine) resource ID>
9084
primary_user_assigned_identity: <one of the UAI resource IDs in the above list>
9185
```
9286
87+
> [!TIP]
88+
> To add a new UAI, you can specify the new UAI ID under the section user_assigned_identities in addition to the existing UAIs, it's required to pass all the existing UAI IDs.<br>
89+
To delete one or more existing UAIs, you can put the UAI IDs which needs to be preserved under the section user_assigned_identities, the rest UAI IDs would be deleted.<br>
90+
To update identity type from SAI to UAI|SAI, you can change type from "user_assigned" to "system_assigned, user_assigned".
91+
9392
# [Python SDK](#tab/python)
9493
9594
[!INCLUDE [sdk v2](../../includes/machine-learning-sdk-v2.md)]
@@ -101,31 +100,14 @@ sub_id="<subscription ID>"
101100
rg_name="<resource group name>"
102101
ws_name="<workspace name>"
103102
client = MLClient(DefaultAzureCredential(), sub_id, rg_name)
103+
# create a workspace with identity type UAI
104104
wps = load_workspace("workspace_uai.yml")
105105
workspace = client.workspaces.begin_create(workspace=wps).result()
106-
# update SAI workspace to SAI&UAI workspace
107-
wps = load_workspace("workspace_sai_and_uai.yml")
106+
# update
107+
wps = load_workspace("workspace_uai.yml")
108108
workspace = client.workspaces.begin_update(workspace=wps).result()
109109
```
110110

111-
Where the contents of *workspace_sai_and_uai.yml* are as follows:
112-
113-
```yaml
114-
name: <workspace name>
115-
location: <region name>
116-
resource_group: <resource group name>
117-
identity:
118-
type: system_assigned, user_assigned
119-
tenant_id: <tenant ID>
120-
user_assigned_identities:
121-
'<UAI resource ID 1>': {}
122-
'<UAI resource ID 2>': {}
123-
storage_account: <storage acccount resource ID>
124-
key_vault: <key vault resource ID>
125-
image_build_compute: <compute(virtual machine) resource ID>
126-
primary_user_assigned_identity: <one of the UAI resource IDs in the above list>
127-
```
128-
129111
# [Studio](#tab/azure-studio)
130112

131113
Not supported currently.

0 commit comments

Comments
 (0)