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: articles/key-vault/secrets/quick-create-bicep.md
+31-5Lines changed: 31 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,31 @@ ms.author: v-eschaffer
21
21
22
22
## Prerequisites
23
23
24
-
To complete this article:
25
-
26
24
* If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
27
25
26
+
* Your Azure AD user object ID is needed by the template to configure permissions. The following procedure gets the object ID (GUID).
27
+
28
+
1. Run the following Azure PowerShell or Azure CLI command by select **Try it**, and then paste the script into the shell pane. To paste the script, right-click the shell, and then select **Paste**.
29
+
30
+
# [CLI](#tab/CLI)
31
+
```azurecli-interactive
32
+
echo "Enter your email address that is used to sign in to Azure:" &&
33
+
read upn &&
34
+
az ad user show --id $upn --query "objectId" &&
35
+
echo "Press [ENTER] to continue ..."
36
+
```
37
+
38
+
# [PowerShell](#tab/PowerShell)
39
+
```azurepowershell-interactive
40
+
$upn = Read-Host -Prompt "Enter your email address used to sign in to Azure"
41
+
(Get-AzADUser -UserPrincipalName $upn).Id
42
+
Write-Host "Press [ENTER] to continue..."
43
+
```
44
+
45
+
---
46
+
47
+
2. Write down the object ID. You need it in the next section of this quickstart.
48
+
28
49
## Review the Bicep file
29
50
30
51
The template used in this quickstart is from [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/key-vault-create/).
@@ -64,18 +85,23 @@ Two Azure resources are defined in the Bicep file:
64
85
65
86
## Review deployed resources
66
87
67
-
Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.
88
+
You can either use the Azure portal to check the key vault and the secret, or use the following Azure CLI or Azure PowerShell script to list the secret created.
68
89
69
90
# [CLI](#tab/CLI)
70
91
71
92
```azurecli-interactive
72
-
az resource list --resource-group exampleRG
93
+
echo "Enter your key vault name:" &&
94
+
read keyVaultName &&
95
+
az keyvault secret list --vault-name $keyVaultName &&
96
+
echo "Press [ENTER] to continue ..."
73
97
```
74
98
75
99
# [PowerShell](#tab/PowerShell)
76
100
77
101
```azurepowershell-interactive
78
-
Get-AzResource -ResourceGroupName exampleRG
102
+
$keyVaultName = Read-Host -Prompt "Enter your key vault name"
0 commit comments