You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 08-console-keyvault/setup.sh
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,4 +8,9 @@ az group create --name ${rg} --location ${location}
8
8
9
9
az keyvault create --location ${location} --name ${kvName} --resource-group ${rg}
10
10
11
+
12
+
# Assign the Key Vault Contributor role to the current user
13
+
userId=$(az ad signed-in-user show --query id --output tsv)
14
+
az role assignment create --assignee ${userId} --role "Key Vault Administrator" --scope /subscriptions/$(az account show --query id --output tsv)/resourceGroups/${rg}/providers/Microsoft.KeyVault/vaults/${kvName}
15
+
11
16
az keyvault secret set --name Message --vault-name ${kvName} --value "Hello from KV"
0 commit comments