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
@@ -111,16 +111,21 @@ To learn more about Azure CLI and how to sign in with it, see [Sign in with Azur
111
111
To create a self-signed certificate and sign a container image in AKV, you must assign proper access policy to a principal. The permissions that you grant for a principal should include at least certificate permissions `Create` and `Get`for creating and get certificates, and key permissions `Sign`for signing. A principal can be user principal, service principal or managed identity. In this tutorial, the access policy is assigned to a signed-in Azure user. To learn more about assigning policy to a principal, see [Assign Access Policy](/azure/key-vault/general/assign-access-policy).
112
112
113
113
### Set the subscription that contains the AKV resource
114
-
```azure-cli
114
+
115
+
```bash
115
116
az account set --subscription <your_subscription_id>
116
117
```
117
118
118
119
### Set the access policy in AKV
119
-
```azure-cli
120
+
121
+
```bash
120
122
USER_ID=$(az ad signed-in-user show --query id -o tsv)
121
123
az keyvault set-policy -n $AKV_NAME --certificate-permissions create get --key-permissions sign --object-id $USER_ID
122
124
```
123
125
126
+
> [!NOTE]
127
+
> The permissions granted are necessary for creating a certificate and signing a container image. Depending on your requirements, you may need to grant additional permissions.
128
+
124
129
## Create a self-signed signing certificate in AKV (Azure CLI)
125
130
126
131
The following steps show how to create a self-signed signing certificate for testing purpose.
@@ -158,24 +163,24 @@ The following steps show how to create a self-signed signing certificate for tes
158
163
159
164
2. Create the certificate.
160
165
161
-
```azure-cli
166
+
```bash
162
167
az keyvault certificate create -n $CERT_NAME --vault-name $AKV_NAME -p @my_policy.json
163
168
```
164
169
165
170
## Sign a container image with Notation CLI and AKV plugin
166
171
167
172
1. Build and push a new image with ACR Tasks. Always use digest to identify the image for signing, because tags are mutable and and can be overwritten.
0 commit comments