@@ -376,47 +376,86 @@ The Azure PowerShell can be used to deploy the Key Vault VM extension to an exis
376
376
* To deploy the extension on a VM:
377
377
378
378
### [ Version-3.0] ( #tab/version3 )
379
-
380
- ``` powershell
381
379
382
- # Build settings
383
- $settings = '{"secretsManagementSettings":
384
- { "pollingIntervalInS": "' + <pollingInterval> +
385
- '", "certificateStoreName": "' + <certStoreName> +
386
- '", "certificateStoreLocation": "' + <certStoreLoc> +
387
- '", "observedCertificates": ["' + <observedCert1> + '","' + <observedCert2> + '"] } }'
388
- $extName = "KeyVaultForLinux"
389
- $extPublisher = "Microsoft.Azure.KeyVault"
390
- $extType = "KeyVaultForLinux"
380
+ The Azure Key Vault VM extension can be deployed with Azure PowerShell. Save Key Vault VM extension settings to a JSON file (settings.json).
381
+
382
+ The following JSON snippets provide example settings for deploying the Key Vault VM extension with PowerShell.
383
+
384
+ ``` json
385
+ {
386
+ "loggingSettings" : {
387
+ "logger" : " fluentd" ,
388
+ "endpoint" : " unix:///var/run/azuremonitoragent/sometenant/default_fluent.socket" ,
389
+ "format" : " forward" ,
390
+ "servicename" : " akvvm_service"
391
+ },
392
+ "secretsManagementSettings" : {
393
+ "pollingIntervalInS" : " 3600" ,
394
+ "linkOnRenewal" : true ,
395
+ "observedCertificates" :
396
+ [
397
+ {
398
+ "url" : " https://<examplekv>.vault.azure.net/secrets/mycertificate1" ,
399
+ "certificateStoreLocation" : " /var/lib/waagent/Microsoft.Azure.KeyVault.Store" ,
400
+ "acls" :
401
+ [
402
+ {
403
+ "user" : " app1" ,
404
+ "group" : " appGroup1"
405
+ },
406
+ {
407
+ "user" : " service1"
408
+ }
409
+ ]
410
+ },
411
+ {
412
+ "url" : " https://<examplekv>.vault.azure.net/secrets/mycertificate2" ,
413
+ "certificateStoreLocation" : " /var/lib/waagent/Microsoft.Azure.KeyVault.Store" ,
414
+ "acls" :
415
+ [
416
+ {
417
+ "user" : " app2"
418
+ }
419
+ ]
420
+ }
421
+ ]},
422
+ "authenticationSettings" : {
423
+ "msiEndpoint" : " http://169.254.169.254/metadata/identity/oauth2/token" ,
424
+ "msiClientId" : " xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx"
425
+ }
426
+ }
427
+ ```
391
428
429
+ * To deploy the extension on a virtual machine:
392
430
393
- # Start the deployment
394
- Set-AzVmExtension -TypeHandlerVersion "2.0" -EnableAutomaticUpgrade true -ResourceGroupName <ResourceGroupName> -Location <Location> -VMName <VMName> -Name $extName -Publisher $extPublisher -Type $extType -SettingString $settings
431
+ ``` powershell
432
+ # Build settings
433
+ $settings = (get-content -raw ".\settings.json")
434
+ $extName = "KeyVaultForLinux"
435
+ $extPublisher = "Microsoft.Azure.KeyVault"
436
+ $extType = "KeyVaultForLinux"
437
+
438
+ # Start the deployment
439
+ Set-AzVmExtension -TypeHandlerVersion "3.0" -ResourceGroupName <ResourceGroupName> -Location <Location> -VMName <VMName> -Name $extName -Publisher $extPublisher -Type $extType -SettingString $settings
395
440
396
441
```
397
442
398
443
* To deploy the extension on a virtual machine scale set:
399
444
400
445
``` powershell
401
-
402
446
# Build settings
403
- $settings = '{"secretsManagementSettings":
404
- { "pollingIntervalInS": "' + <pollingInterval> +
405
- '", "certificateStoreName": "' + <certStoreName> +
406
- '", "certificateStoreLocation": "' + <certStoreLoc> +
407
- '", "observedCertificates": ["' + <observedCert1> + '","' + <observedCert2> + '"] } }'
447
+ $settings = (get-content -raw ".\settings.json")
408
448
$extName = "KeyVaultForLinux"
409
449
$extPublisher = "Microsoft.Azure.KeyVault"
410
450
$extType = "KeyVaultForLinux"
411
-
412
- # Add Extension to VMSS
451
+
452
+ # Add extension to Virtual Machine Scale Sets
413
453
$vmss = Get-AzVmss -ResourceGroupName <ResourceGroupName> -VMScaleSetName <VmssName>
414
- Add-AzVmssExtension -VirtualMachineScaleSet $vmss -Name $extName -Publisher $extPublisher -Type $extType -TypeHandlerVersion "2 .0" -EnableAutomaticUpgrade true -Setting $settings
415
-
454
+ Add-AzVmssExtension -VirtualMachineScaleSet $vmss -Name $extName -Publisher $extPublisher -Type $extType -TypeHandlerVersion "3 .0" -Setting $settings
455
+
416
456
# Start the deployment
417
- Update-AzVmss -ResourceGroupName <ResourceGroupName> -VMScaleSetName <VmssName> -VirtualMachineScaleSet $vmss
457
+ Update-AzVmss -ResourceGroupName <ResourceGroupName> -VMScaleSetName <VmssName> -VirtualMachineScaleSet $vmss
418
458
```
419
-
420
459
### [ Version-1.0/2.0] ( #tab/version12 )
421
460
422
461
``` powershell
0 commit comments