Skip to content

Commit 10a3329

Browse files
committed
update formats
Signed-off-by: Yi Zha <[email protected]>
1 parent d6f2165 commit 10a3329

File tree

2 files changed

+50
-53
lines changed

2 files changed

+50
-53
lines changed

articles/container-registry/container-registry-tutorial-sign-build-push.md

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ The `AcrPull` and `AcrPush` roles are required for signing container images in A
109109
110110
1. Set the subscription that contains the ACR resource
111111
112-
```bash
113-
az account set --subscription $ACR_SUB_ID
114-
```
112+
```bash
113+
az account set --subscription $ACR_SUB_ID
114+
```
115115
116116
2. Assign the roles
117117
118-
```bash
119-
USER_ID=$(az ad signed-in-user show --query id -o tsv)
120-
az role assignment create --role "AcrPull" --role "AcrPush" --assignee $USER_ID --scope "/subscriptions/$ACR_SUB_ID/resourceGroups/$ACR_RG/providers/Microsoft.ContainerRegistry/registries/$ACR_NAME"
121-
```
118+
```bash
119+
USER_ID=$(az ad signed-in-user show --query id -o tsv)
120+
az role assignment create --role "AcrPull" --role "AcrPush" --assignee $USER_ID --scope "/subscriptions/$ACR_SUB_ID/resourceGroups/$ACR_RG/providers/Microsoft.ContainerRegistry/registries/$ACR_NAME"
121+
```
122122
123123
### Authorize access to AKV
124124
@@ -127,7 +127,6 @@ In this section, we’ll explore two options for authorizing access to AKV.
127127
#### Use Azure RBAC (Recommended)
128128
129129
The following roles are required for signing using self-signed certificates:
130-
131130
- `Key Vault Certificates Officer` for creating and reading certificates
132131
- `Key Vault Certificates User`for reading existing certificates
133132
- `Key Vault Crypto User` for signing operations
@@ -136,21 +135,20 @@ To learn more about Key Vault access with Azure RBAC, see [Use an Azure RBAC for
136135
137136
1. Set the subscription that contains the AKV resource
138137
139-
```bash
140-
az account set --subscription $AKV_SUB_ID
141-
```
138+
```bash
139+
az account set --subscription $AKV_SUB_ID
140+
```
142141
143142
2. Assign the roles
144143
145-
```bash
146-
USER_ID=$(az ad signed-in-user show --query id -o tsv)
147-
az role assignment create --role "Key Vault Certificates Officer" --role "Key Vault Crypto User" --assignee $USER_ID --scope "/subscriptions/$AKV_SUB_ID/resourceGroups/$AKV_RG/providers/Microsoft.KeyVault/vaults/$AKV_NAME"
148-
```
144+
```bash
145+
USER_ID=$(az ad signed-in-user show --query id -o tsv)
146+
az role assignment create --role "Key Vault Certificates Officer" --role "Key Vault Crypto User" --assignee $USER_ID --scope "/subscriptions/$AKV_SUB_ID/resourceGroups/$AKV_RG/providers/Microsoft.KeyVault/vaults/$AKV_NAME"
147+
```
149148
150149
#### Assign access policy in AKV (legacy)
151150
152151
The following permissions are required for an identity:
153-
154152
- `Create` permissions for creating a certificate
155153
- `Get` permissions for reading existing certificates
156154
- `Sign` permissions for signing operations
@@ -159,16 +157,16 @@ To learn more about assigning policy to a principal, see [Assign Access Policy](
159157
160158
1. Set the subscription that contains the AKV resource:
161159
162-
```bash
163-
az account set --subscription $AKV_SUB_ID
164-
```
160+
```bash
161+
az account set --subscription $AKV_SUB_ID
162+
```
165163
166164
2. Set the access policy in AKV:
167165
168-
```bash
169-
USER_ID=$(az ad signed-in-user show --query id -o tsv)
170-
az keyvault set-policy -n $AKV_NAME --certificate-permissions create get --key-permissions sign --object-id $USER_ID
171-
```
166+
```bash
167+
USER_ID=$(az ad signed-in-user show --query id -o tsv)
168+
az keyvault set-policy -n $AKV_NAME --certificate-permissions create get --key-permissions sign --object-id $USER_ID
169+
```
172170
173171
> [!IMPORTANT]
174172
> This example shows the minimum permissions needed for creating a certificate and signing a container image. Depending on your requirements, you may need to grant additional permissions.

articles/container-registry/container-registry-tutorial-sign-trusted-ca.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ The `AcrPull` and `AcrPush` roles are required for building and signing containe
164164
165165
1. Set the subscription that contains the ACR resource
166166
167-
```bash
168-
az account set --subscription $ACR_SUB_ID
169-
```
167+
```bash
168+
az account set --subscription $ACR_SUB_ID
169+
```
170170
171171
1. Assign the roles
172172
173-
```bash
174-
USER_ID=$(az ad signed-in-user show --query id -o tsv)
175-
az role assignment create --role "AcrPull" --role "AcrPush" --assignee $USER_ID --scope "/subscriptions/$ACR_SUB_ID/resourceGroups/$ACR_RG/providers/Microsoft.ContainerRegistry/registries/$ACR_NAME"
176-
```
173+
```bash
174+
USER_ID=$(az ad signed-in-user show --query id -o tsv)
175+
az role assignment create --role "AcrPull" --role "AcrPush" --assignee $USER_ID --scope "/subscriptions/$ACR_SUB_ID/resourceGroups/$ACR_RG/providers/Microsoft.ContainerRegistry/registries/$ACR_NAME"
176+
```
177177
178178
### Build and push container images to ACR
179179
@@ -193,42 +193,42 @@ az role assignment create --role "AcrPull" --role "AcrPush" --assignee $USER_ID
193193
IMAGE=$REGISTRY/${REPO}@$DIGEST
194194
```
195195
196-
In this tutorial, if the image has already been built and is stored in the registry, the tag serves as an identifier for that image for convenience.
196+
In this tutorial, if the image has already been built and is stored in the registry, the tag serves as an identifier for that image for convenience.
197197
198-
```bash
199-
IMAGE=$REGISTRY/${REPO}@$TAG
200-
```
198+
```bash
199+
IMAGE=$REGISTRY/${REPO}@$TAG
200+
```
201201
202202
### Authoring access to AKV
203203
204204
#### Use Azure RBAC (Recommended)
205205
206206
1. Set the subscription that contains the AKV resource
207207
208-
```bash
209-
az account set --subscription $AKV_SUB_ID
210-
```
208+
```bash
209+
az account set --subscription $AKV_SUB_ID
210+
```
211211
212212
1. Assign the roles
213213
214-
If the certificate contains the entire certificate chain, the principal must be assigned with the following roles:
215-
- `Key Vault Secrets User` for reading secrets
216-
- `Key Vault Certificates User`for reading certificates
217-
- `Key Vault Crypto User` for signing operations
214+
If the certificate contains the entire certificate chain, the principal must be assigned with the following roles:
215+
- `Key Vault Secrets User` for reading secrets
216+
- `Key Vault Certificates User`for reading certificates
217+
- `Key Vault Crypto User` for signing operations
218218
219-
```bash
220-
USER_ID=$(az ad signed-in-user show --query id -o tsv)
221-
az role assignment create --role "Key Vault Secrets User" --role "Key Vault Certificates User" --role "Key Vault Crypto User" --assignee $USER_ID --scope "/subscriptions/$AKV_SUB_ID/resourceGroups/$AKV_RG/providers/Microsoft.KeyVault/vaults/$AKV_NAME"
222-
```
219+
```bash
220+
USER_ID=$(az ad signed-in-user show --query id -o tsv)
221+
az role assignment create --role "Key Vault Secrets User" --role "Key Vault Certificates User" --role "Key Vault Crypto User" --assignee $USER_ID --scope "/subscriptions/$AKV_SUB_ID/resourceGroups/$AKV_RG/providers/Microsoft.KeyVault/vaults/$AKV_NAME"
222+
```
223223
224-
If the certificate doesn't contain the chain, the principal must be assigned with the following roles:
225-
- `Key Vault Certificates User`for reading certificates
226-
- `Key Vault Crypto User` for signing operations
224+
If the certificate doesn't contain the chain, the principal must be assigned with the following roles:
225+
- `Key Vault Certificates User`for reading certificates
226+
- `Key Vault Crypto User` for signing operations
227227

228-
```bash
229-
USER_ID=$(az ad signed-in-user show --query id -o tsv)
230-
az role assignment create --role "Key Vault Certificates User" --role "Key Vault Crypto User" --assignee $USER_ID --scope "/subscriptions/$AKV_SUB_ID/resourceGroups/$AKV_RG/providers/Microsoft.KeyVault/vaults/$AKV_NAME"
231-
```
228+
```bash
229+
USER_ID=$(az ad signed-in-user show --query id -o tsv)
230+
az role assignment create --role "Key Vault Certificates User" --role "Key Vault Crypto User" --assignee $USER_ID --scope "/subscriptions/$AKV_SUB_ID/resourceGroups/$AKV_RG/providers/Microsoft.KeyVault/vaults/$AKV_NAME"
231+
```
232232

233233
To learn more about Key Vault access with Azure RBAC, see [Use an Azure RBAC for managing access](/azure/key-vault/general/rbac-guide).
234234

@@ -279,7 +279,6 @@ To learn more about assigning policy to a principal, see [Assign Access Policy](
279279
```
280280
281281
To authenticate with AKV, by default, the following credential types if enabled will be tried in order:
282-
283282
- [Environment credential](/dotnet/api/azure.identity.environmentcredential)
284283
- [Workload identity credential](/dotnet/api/azure.identity.workloadidentitycredential)
285284
- [Managed identity credential](/dotnet/api/azure.identity.managedidentitycredential)

0 commit comments

Comments
 (0)