Skip to content

Commit bd7c42d

Browse files
Merge pull request #278812 from seesharprun/cosmos-nosql-passwordless-migration
Cosmos DB | Update NoSQL passwordless migration article
2 parents 8f590ec + 0e1e04f commit bd7c42d

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

articles/cosmos-db/nosql/migrate-passwordless.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn to migrate existing applications away from connection strings
55
author: alexwolfmsft
66
ms.author: alexwolf
77
ms.reviewer: randolphwest
8-
ms.date: 06/01/2023
8+
ms.date: 06/20/2024
99
ms.service: cosmos-db
1010
ms.topic: how-to
1111
ms.custom: devx-track-csharp, passwordless-java, passwordless-js, passwordless-python, passwordless-dotnet, passwordless-go, devx-track-azurecli
@@ -208,22 +208,15 @@ Complete the following steps in the Azure portal to associate an identity with y
208208

209209
Grant permissions to the managed identity by assigning it the custom role you created, just like you did with your local development user.
210210

211-
To assign a role at the resource level using the Azure CLI, you first must retrieve the resource ID using the [az cosmosdb show](/cli/azure/cosmosdb) command. You can filter the output properties using the `--query` parameter.
211+
Assign roles using the [`az role assignment`](/cli/azure/role/assignment) command of the Azure CLI.
212212

213213
```azurecli
214-
az cosmosdb show \
215-
--resource-group '<resource-group-name>' \
216-
--name '<cosmosdb-name>' \
217-
--query id
218-
```
219-
220-
Copy the output ID from the preceding command. You can then assign roles using the [az role assignment](/cli/azure/role/assignment) command of the Azure CLI.
221-
222-
```azurecli
223-
az role assignment create \
224-
--assignee "<your-managed-identity-name>" \
225-
--role "PasswordlessReadWrite" \
226-
--scope "<cosmosdb-resource-id>"
214+
az cosmosdb sql role assignment create \
215+
--account-name <cosmosdb-account-name> \
216+
--resource-group <resource-group-name> \
217+
--scope "/" \
218+
--principal-id <managed-identity-id> \
219+
--role-definition-id <your-custom-role-id>
227220
```
228221

229222
[!INCLUDE [Code changes to use user-assigned managed identity](../../../includes/passwordless/migration-guide/passwordless-user-assigned-managed-identity.md)]

0 commit comments

Comments
 (0)