1.5 KiB
1.5 KiB
Very simple deployment of a Linux VM
This template allows you to deploy a simple Linux VM by retrieving the password that is stored in a Key Vault. Therefore the password is never put in plain text in the template parameter file.
Add Secret to the Key Vault
You can add the password to the Key Vault using the below commands:
PowerShell
$Secret = ConvertTo-SecureString -String 'Password' -AsPlainText -Force
Set-AzureKeyVaultSecret -VaultName 'Contoso' -Name 'ITSecret' -SecretValue $Secret
CLI
azure keyvault secret set --vault-name Contoso --secret-name ITSecret --value azurepass
Enable Key Vault for VM and Template secret access
After this you'll need to enable the Key Vault for template deployment. You can do this using the following commands:
PowerShell
Set-AzureRmKeyVaultAccessPolicy -VaultName Contoso -EnabledForTemplateDeployment
CLI
azure keyvault set-policy --vault-name Contoso --enabled-for-template-deployment true