@@ -60,7 +60,6 @@ After you enable customer-managed keys, you need to associate the customer manag
60
60
```azurecli-interactive
61
61
az keyvault update --hsm-name contoso-SB-BYOK-keyvault --resource-group ContosoRG --enable-purge-protection true
62
62
```
63
-
64
63
---
65
64
66
65
4. Create keys by following these steps:
@@ -197,7 +196,7 @@ This section shows you how to create an Azure Service Bus namespace with managed
197
196
198
197
### Grant Service Bus namespace identity access to key vault
199
198
200
- 1. Set the key vault access policy so that the managed identity of the Service Bus namespace can access key value in the key vault. Use the ID of the Service Bus namespace from the previous section.
199
+ Set the key vault access policy so that the managed identity of the Service Bus namespace can access key value in the key vault. Use the ID of the Service Bus namespace from the previous section.
201
200
202
201
```powershell
203
202
$identity = (Get-AzureRmResource -ResourceId $ServiceBusNamespaceId -ExpandProperties).Identity
@@ -276,64 +275,63 @@ In this step, you update the Service Bus namespace with key vault information.
276
275
}
277
276
```
278
277
279
- 1. Create a template parameter file: **UpdateServiceBusNamespaceWithEncryptionParams.json**.
280
-
281
- > [!NOTE]
282
- > Replace the following values:
283
- > - `<ServiceBusNamespaceName>` - Name of your Service Bus namespace
284
- > - `<Location>` - Location of your Service Bus namespace
285
- > - `<KeyVaultName>` - Name of your key vault
286
- > - `<KeyName>` - Name of the key in the key vault
287
-
288
- # [Key Vault](#tab/Key-Vault)
289
-
290
- ```json
291
- {
292
- "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
293
- "contentVersion":"1.0.0.0",
294
- "parameters":{
295
- "namespaceName":{
296
- "value":"<ServiceBusNamespaceName>"
297
- },
298
- "location":{
299
- "value":"<Location>"
300
- },
301
- "keyName":{
302
- "value":"<KeyName>"
303
- },
304
- "keyVaultUri":{
305
- "value":"https://<KeyVaultName>.vault.azure.net"
278
+ 2. Create a template parameter file: **UpdateServiceBusNamespaceWithEncryptionParams.json**.
279
+
280
+ > [!NOTE]
281
+ > Replace the following values:
282
+ > - `<ServiceBusNamespaceName>` - Name of your Service Bus namespace
283
+ > - `<Location>` - Location of your Service Bus namespace
284
+ > - `<KeyVaultName>` - Name of your key vault
285
+ > - `<KeyName>` - Name of the key in the key vault
286
+
287
+ # [Key Vault](#tab/Key-Vault)
288
+
289
+ ```json
290
+ {
291
+ "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
292
+ "contentVersion":"1.0.0.0",
293
+ "parameters":{
294
+ "namespaceName":{
295
+ "value":"<ServiceBusNamespaceName>"
296
+ },
297
+ "location":{
298
+ "value":"<Location>"
299
+ },
300
+ "keyName":{
301
+ "value":"<KeyName>"
302
+ },
303
+ "keyVaultUri":{
304
+ "value":"https://<KeyVaultName>.vault.azure.net"
305
+ }
306
306
}
307
307
}
308
- }
309
- ```
310
-
311
- # [ Key Vault Managed HSM ] ( #tab/Key-Vault-Managed-HSM )
312
-
313
- ``` json
314
- {
315
- "$schema " :" https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json# " ,
316
- "contentVersion" : " 1.0.0.0 " ,
317
- "parameters " :{
318
- "namespaceName" :{
319
- "value" : " <ServiceBusNamespaceName> "
320
- },
321
- "location" :{
322
- "value" : " <Location> "
323
- },
324
- "keyName" :{
325
- "value" : " <KeyName> "
326
- },
327
- "keyVaultUri" :{
328
- "value" : " https://<KeyVaultName>.managedhsm.azure.net "
308
+ ```
309
+
310
+ # [ Key Vault Managed HSM ] ( #tab/Key-Vault-Managed-HSM )
311
+
312
+ ``` json
313
+ {
314
+ "$schema" : " https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json# " ,
315
+ "contentVersion " :" 1.0.0.0 " ,
316
+ "parameters" :{
317
+ "namespaceName " :{
318
+ "value" : " <ServiceBusNamespaceName> "
319
+ },
320
+ "location" :{
321
+ "value" : " <Location> "
322
+ },
323
+ "keyName" :{
324
+ "value" : " <KeyName> "
325
+ },
326
+ "keyVaultUri" :{
327
+ "value" : " https://<KeyVaultName>.managedhsm.azure.net "
328
+ }
329
329
}
330
330
}
331
- }
332
- ```
331
+ ```
332
+ ---
333
333
334
- ---
335
-
336
- 1 . Run the following PowerShell command to deploy the Resource Manager template. Replace ` {MyRG} ` with the name of your resource group before running the command.
334
+ 3 . Run the following PowerShell command to deploy the Resource Manager template. Replace ` {MyRG} ` with the name of your resource group before running the command.
337
335
338
336
``` powershell
339
337
New-AzResourceGroupDeployment -Name UpdateServiceBusNamespaceWithEncryption -ResourceGroupName {MyRG} -TemplateFile ./UpdateServiceBusNamespaceWithEncryption.json -TemplateParameterFile ./UpdateServiceBusNamespaceWithEncryptionParams.json
@@ -474,68 +472,66 @@ This section gives you an example that shows you how to do the following tasks u
474
472
}
475
473
```
476
474
477
- 1. Create a template parameter file: **CreateServiceBusNamespaceWithUserIdentityAndEncryptionParams.json**.
478
-
479
- # [Key Vault](#tab/Key-Vault)
480
-
481
- ```json
482
- {
483
- "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
484
- "contentVersion":"1.0.0.0",
485
- "parameters":{
486
- "namespaceName":{
487
- "value":"<ServiceBusNamespaceName>"
488
- },
489
- "location":{
490
- "value":"<Location>"
491
- },
492
- "keyVaultUri":{
493
- "value":"https://<KeyVaultName>.vault.azure.net"
494
- },
495
- "keyName":{
496
- "value":"<KeyName>"
497
- },
498
- "identity": {
499
- "value": {
500
- "userAssignedIdentity": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER MANAGED IDENTITY NAME>"
475
+ 2. Create a template parameter file: **CreateServiceBusNamespaceWithUserIdentityAndEncryptionParams.json**.
476
+
477
+ # [Key Vault](#tab/Key-Vault)
478
+
479
+ ```json
480
+ {
481
+ "$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
482
+ "contentVersion":"1.0.0.0",
483
+ "parameters":{
484
+ "namespaceName":{
485
+ "value":"<ServiceBusNamespaceName>"
486
+ },
487
+ "location":{
488
+ "value":"<Location>"
489
+ },
490
+ "keyVaultUri":{
491
+ "value":"https://<KeyVaultName>.vault.azure.net"
492
+ },
493
+ "keyName":{
494
+ "value":"<KeyName>"
495
+ },
496
+ "identity": {
497
+ "value": {
498
+ "userAssignedIdentity": "/subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER MANAGED IDENTITY NAME>"
499
+ }
501
500
}
502
- }
503
- }
504
- }
505
- ```
506
-
507
- # [ Key Vault Managed HSM] ( #tab/Key-Vault-Managed-HSM )
508
-
509
- ``` json
510
- {
511
- "$schema" :" https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#" ,
512
- "contentVersion" :" 1.0.0.0" ,
513
- "parameters" :{
514
- "namespaceName" :{
515
- "value" :" <ServiceBusNamespaceName>"
516
- },
517
- "location" :{
518
- "value" :" <Location>"
519
- },
520
- "keyVaultUri" :{
521
- "value" :" https://<KeyVaultName>.managedhsm.azure.net"
522
- },
523
- "keyName" :{
524
- "value" :" <KeyName>"
525
- },
526
- "identity" : {
527
- "value" : {
528
- "userAssignedIdentity" : " /subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER MANAGED IDENTITY NAME>"
529
501
}
530
502
}
503
+ ```
504
+
505
+ # [ Key Vault Managed HSM] ( #tab/Key-Vault-Managed-HSM )
506
+
507
+ ``` json
508
+ {
509
+ "$schema" :" https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#" ,
510
+ "contentVersion" :" 1.0.0.0" ,
511
+ "parameters" :{
512
+ "namespaceName" :{
513
+ "value" :" <ServiceBusNamespaceName>"
514
+ },
515
+ "location" :{
516
+ "value" :" <Location>"
517
+ },
518
+ "keyVaultUri" :{
519
+ "value" :" https://<KeyVaultName>.managedhsm.azure.net"
520
+ },
521
+ "keyName" :{
522
+ "value" :" <KeyName>"
523
+ },
524
+ "identity" : {
525
+ "value" : {
526
+ "userAssignedIdentity" : " /subscriptions/<AZURE SUBSCRIPTION ID>/resourceGroups/<RESOURCE GROUP NAME>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<USER MANAGED IDENTITY NAME>"
527
+ }
528
+ }
529
+ }
531
530
}
532
- }
533
- ```
534
-
535
- ---
531
+ ```
532
+ ---
536
533
537
- In the parameter file, replace placeholders with appropriate values.
538
-
534
+ In the parameter file, replace placeholders with appropriate values.
539
535
| Placeholder | value |
540
536
| ----------- | ----- |
541
537
| ` <ServiceBusNamespaceName> ` | Name of the Service Bus namespace. |
@@ -552,7 +548,6 @@ This section gives you an example that shows you how to do the following tasks u
552
548
New-AzResourceGroupDeployment -Name CreateServiceBusNamespaceWithEncryption -ResourceGroupName {MyRG} -TemplateFile ./ CreateServiceBusNamespaceWithUserIdentityAndEncryption.json -TemplateParameterFile ./ CreateServiceBusNamespaceWithUserIdentityAndEncryptionParams.json
553
549
```
554
550
555
-
556
551
## Use both user-assigned and system-assigned identities
557
552
A namespace can have both system-assigned and user-assigned identities at the same time. In this case, the `type` property would be `SystemAssigned`, `UserAssigned` as shown in the following example.
558
553
0 commit comments