Skip to content

Commit d9c5497

Browse files
committed
update
1 parent 5a1ae84 commit d9c5497

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
author: msmbaldwin
3+
ms.service: key-vault
4+
ms.topic: include
5+
ms.date: 04/04/2024
6+
ms.author: msmbaldwin
7+
8+
# Used by articles that show how to assign a Key Vault access policy
9+
10+
---
11+
12+
To grant your user account permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create).
13+
14+
```azurecli
15+
az role assignment create --role "Key Vault Secrets User" --assignee <your-email-address> --scope /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.KeyVault/vaults/<your-unique-keyvault-name>
16+
```
17+
18+
Replace <your-email-address>, <subscription-id>, <resource-group-name>, and <your-unique-keyvault-name> with your actual values. <your-email-address> is your sign-in name.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
author: msmbaldwin
3+
ms.service: key-vault
4+
ms.topic: include
5+
ms.date: 04/04/2024
6+
ms.author: msmbaldwin
7+
8+
# Used by articles that show how to assign a Key Vault access policy
9+
10+
---
11+
12+
To grant your user account permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create).
13+
14+
```
15+
New-AzRoleAssignment -RoleDefinitionName "Key Vault Secrets User" -SignInName <your-email-address> -Scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.KeyVault/vaults/<your-unique-keyvault-name>"
16+
```
17+
18+
Replace <your-email-address>, <subscription-id>, <resource-group-name>, and <your-unique-keyvault-name> with your actual values. <your-email-address> is your sign-in name; you can instead use the `-ObjectId` parameter and a Microsoft Entra Object ID.

includes/key-vault-quickstart-rbac.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
author: msmbaldwin
3+
ms.service: key-vault
4+
ms.topic: include
5+
ms.date: 04/04/2024
6+
ms.author: msmbaldwin
7+
8+
# Used by articles that show how to assign a Key Vault access policy
9+
10+
---
11+
12+
### [Azure CLI](#tab/azure-cli)
13+
14+
To grant your application permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure CLI command [az role assignment create](/cli/azure/role/assignment#az-role-assignment-create).
15+
16+
```azurecli
17+
az role assignment create --role "Key Vault Secrets User" --assignee <app-id> --scope /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.KeyVault/vaults/<your-unique-keyvault-name>
18+
```
19+
20+
### [Azure PowerShell](#tab/azure-powershell)
21+
22+
To grant your application permissions to your key vault through Role-Based Access Control (RBAC), assign a role using the Azure PowerShell cmdlet [New-AzRoleAssignment](//powershell/module/az.keyvault/new-azRoleAssignment).
23+
24+
```
25+
New-AzRoleAssignment -ObjectId <app-id> -RoleDefinitionName "Key Vault Secrets User" -Scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.KeyVault/vaults/<your-unique-keyvault-name>"
26+
```
27+
28+
---
29+
30+
Replace <app-id>, <subscription-id>, <resource-group-name>, and <your-unique-keyvault-name> with your actual values. <app-id> is the Application (client) ID of your registered application in Azure AD.

0 commit comments

Comments
 (0)