Skip to content

Commit d4187b5

Browse files
authored
Add note to Add-AzVMSecret.md (Ready to Merge) (Azure#15579)
* Update Add-AzVMSecret.md * Update Add-AzVMSecret.md * Update Add-AzVMSecret.md * Update Add-AzVMSecret.md
1 parent 871b804 commit d4187b5

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/Compute/Compute/help/Add-AzVMSecret.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,19 @@ Add-AzVMSecret [-VM] <PSVirtualMachine> [[-SourceVaultId] <String>] [[-Certifica
1919
```
2020

2121
## DESCRIPTION
22+
2223
The **Add-AzVMSecret** cmdlet adds a secret to a virtual machine.
2324
This value lets you add a certificate to the virtual machine.
2425
The secret must be stored in a Key Vault.
2526
For more information about Key Vault, see [What is Azure Key Vault?](https://azure.microsoft.com/en-us/documentation/articles/key-vault-whatis/).
2627
For more information about the cmdlets, see [Azure Key Vault Cmdlets](/powershell/module/az.keyvault) or the [Set-AzKeyVaultSecret](/powershell/module/az.keyvault/set-azkeyvaultsecret) cmdlet.
2728

28-
## EXAMPLES
29-
30-
### Example 1: Add a secret to a virtual machine using the Azure Key Vault virtul machine extension
31-
To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows).
29+
> [!NOTE]
30+
> To install certificates on a virtual machine it is recommended to use the [Azure Key Vault virtual machine extension for Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) or the [Azure Key Vault virtual machine extension for Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows) instead of `Add-AzVMSecret`.
3231
33-
```powershell
34-
# Build settings
35-
PS C:\> $settings = @{
36-
secretsManagementSettings = @{
37-
pollingIntervalInS = "<pollingInterval>"
38-
certificateStoreName = "<certStoreName>"
39-
certificateStoreLocation = "<certStoreLoc>"
40-
observedCertificates = @("<observedCert1>", "<observedCert2>")
41-
}
42-
} | ConvertTo-Json
43-
PS C:\> $extName = "KeyVaultForLinux"
44-
PS C:\> $extPublisher = "Microsoft.Azure.KeyVault"
45-
PS C:\> $extType = "KeyVaultForLinux"
46-
# Start the deployment
47-
PS C:\> Set-AzVmExtension -TypeHandlerVersion "2.0" -ResourceGroupName <ResourceGroupName> -Location <Location> -VMName <VMName> -Name $extName -Publisher $extPublisher -Type $extType -SettingString $settings
48-
```
32+
## EXAMPLES
4933

50-
### Example 2: Add a secret to a virtual machine using Add-AzVMSecret
34+
### Example: Add a secret to a virtual machine using Add-AzVMSecret
5135
```powershell
5236
PS C:\> $VirtualMachine = New-AzVMConfig -VMName "VirtualMachine07" -VMSize "Standard_A1" -AvailabilitySetID $AvailabilitySet.Id
5337
PS C:\> $Credential = Get-Credential

0 commit comments

Comments
 (0)