Skip to content

Commit 4151772

Browse files
Merge pull request #211114 from jlichwa/patch-26
Update active-directory-msi-cross-tenant-cmk-create-identities-author…
2 parents 80d9364 + 0261967 commit 4151772

File tree

1 file changed

+28
-32
lines changed

1 file changed

+28
-32
lines changed

includes/active-directory-msi-cross-tenant-cmk-create-identities-authorize-key-vault.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,6 @@ To install the service provider's registered application in the customer's tenan
208208
- Use [Microsoft Graph](/graph/api/serviceprincipal-post-serviceprincipals), [Microsoft Graph PowerShell](/powershell/module/microsoft.graph.applications/new-mgserviceprincipal?view=graph-powershell-beta&preserve-view=true), [Azure PowerShell](/powershell/module/az.resources/new-azadserviceprincipal), or [Azure CLI](/cli/azure/ad/sp#az-ad-sp-create) to manually create the service principal.
209209
- Construct an [admin-consent URL](../articles/active-directory/manage-apps/grant-admin-consent.md#construct-the-url-for-granting-tenant-wide-admin-consent) and grant tenant-wide consent to create the service principal. You'll need to provide them with your AppId.
210210

211-
#### The customer assigns Key Vault Contributor and Key Vault Crypto Officer roles to a user account
212-
213-
This step ensures that you can create the key vault and encryption keys.
214-
215-
1. Navigate to your key vault and select **Access Control (IAM)** from the left pane.
216-
1. Under **Grant access to this resource**, select **Add role assignment**.
217-
1. Search for and select **Key Vault Contributor**.
218-
1. Under **Members**, select **User, group, or service principal**.
219-
1. Select **Members** and search for your user account.
220-
1. Select **Review + Assign**.
221-
1. Repeat this process to assign the **Key Vault Crypto Officer** role to your user account.
222-
223211
#### The customer creates a key vault
224212

225213
To create the key vault, the user's account must be assigned the **Key Vault Contributor** role or another role that permits creation of a key vault.
@@ -238,6 +226,17 @@ Take note of the **Vault name** and **Vault URI**. Applications that access your
238226

239227
For more information, see [Quickstart - Create an Azure Key Vault with the Azure portal](../articles/key-vault/general/quick-create-portal.md).
240228

229+
#### The customer assigns Key Vault Crypto Officer role to a user account
230+
231+
This step ensures that you can create encryption keys.
232+
233+
1. Navigate to your key vault and select **Access Control (IAM)** from the left pane.
234+
1. Under **Grant access to this resource**, select **Add role assignment**.
235+
1. Search for and select **Key Vault Crypto Officer**.
236+
1. Under **Members**, select **User, group, or service principal**.
237+
1. Select **Members** and search for your user account.
238+
1. Select **Review + Assign**.
239+
241240
#### The customer creates an encryption key
242241

243242
To create the encryption key, the user's account must be assigned the **Key Vault Crypto Officer** role or another role that permits creation of a key.
@@ -290,22 +289,21 @@ $serviceprincipalObject = New-AzADServicePrincipal -ApplicationId
290289
# $serviceprincipalObject = Get-AzADServicePrincipal -ApplicationId $addObject.Id
291290
```
292291

293-
#### The customer assigns Key Vault Contributor and Key Vault Crypto Officer roles to a user account
292+
#### The customer creates a key vault
294293

295-
This step ensures that you can create the key vault and encryption keys.
294+
To create the key vault, the customer's account must be assigned the **Key Vault Contributor** role or another role that permits creation of a key vault.
296295

297296
```azurepowershell
298-
$currentUserObjectId="object-id-of-the-user"
299-
New-AzRoleAssignment -RoleDefinitionName "Key Vault Contributor" -Scope /subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Microsoft.KeyVault/vaults/$vaultName -ObjectId $currentUserObjectId
300-
New-AzRoleAssignment -RoleDefinitionName "Key Vault Crypto Officer" -Scope /subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Microsoft.KeyVault/vaults/$vaultName -ObjectId $currentUserObjectId
297+
New-AzKeyVault -Location $location -Name $vaultName -ResourceGroupName $rgName -SubscriptionId $subscriptionId -EnablePurgeProtection -EnableRbacAuthorization
301298
```
302299

303-
#### The customer creates a key vault
300+
#### The customer assigns Key Vault Crypto Officer role to a user account
304301

305-
To create the key vault, the customer's account must be assigned the **Key Vault Contributor** role or another role that permits creation of a key vault.
302+
This step ensures that you can create the key vault and encryption keys.
306303

307304
```azurepowershell
308-
New-AzKeyVault -Location $location -Name $vaultName -ResourceGroupName $rgName -SubscriptionId $subscriptionId -EnablePurgeProtection -EnableRbacAuthorization
305+
$currentUserObjectId="object-id-of-the-user"
306+
New-AzRoleAssignment -RoleDefinitionName "Key Vault Crypto Officer" -Scope /subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Microsoft.KeyVault/vaults/$vaultName -ObjectId $currentUserObjectId
309307
```
310308

311309
#### The customer creates an encryption key
@@ -350,7 +348,16 @@ export appId='<replace-the-multi-tenant-applicationID>' #appId from Phase 1.
350348
export appObjectId=$(az ad sp create --id $appId --query id --out tsv)
351349
```
352350

353-
#### The customer assigns Key Vault Contributor and Key Vault Crypto Officer roles to a user account
351+
#### The customer creates a key vault
352+
353+
To create the key vault, the customer's account must be assigned the **Key Vault Contributor** role or another role that permits creation of a key vault.
354+
355+
```azurecli
356+
export vaultName="mykeyvaultname"
357+
az keyvault create --location $location --name $vaultName --resource-group $rgName --subscription $subscriptionId --enable-purge-protection true --enable-rbac-authorization true --query name --out tsv
358+
```
359+
360+
#### The customer assigns Key Vault Crypto Officer role to a user account
354361

355362
This step ensures that you can create the key vault and encryption keys.
356363

@@ -362,20 +369,9 @@ location="westcentralus"
362369
az group create --location $location --name $rgName
363370
export currentUserObjectId=$(az ad signed-in-user show --query id --out tsv)
364371
365-
az role assignment create --role "Key Vault Contributor" --scope /subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Microsoft.KeyVault/vaults/$vaultName --assignee-object-id $currentUserObjectId
366-
367372
az role assignment create --role "Key Vault Crypto Officer" --scope /subscriptions/$subscriptionId/resourceGroups/$rgName/providers/Microsoft.KeyVault/vaults/$vaultName --assignee-object-id $currentUserObjectId
368373
```
369374

370-
#### The customer creates a key vault
371-
372-
To create the key vault, the customer's account must be assigned the **Key Vault Contributor** role or another role that permits creation of a key vault.
373-
374-
```azurecli
375-
export vaultName="mykeyvaultname"
376-
az keyvault create --location $location --name $vaultName --resource-group $rgName --subscription $subscriptionId --enable-purge-protection true --enable-rbac-authorization true --query name --out tsv
377-
```
378-
379375
#### The customer creates an encryption key
380376

381377
To create the encryption key, the user's account must be assigned the **Key Vault Crypto Officer** role or another role that permits creation of a key.

0 commit comments

Comments
 (0)