Skip to content

Instantly share code, notes, and snippets.

@JanneMattila
Created August 25, 2016 13:15
Show Gist options
  • Save JanneMattila/d75c925f53e24ff0a97c703cfe2b2cd9 to your computer and use it in GitHub Desktop.
Save JanneMattila/d75c925f53e24ff0a97c703cfe2b2cd9 to your computer and use it in GitHub Desktop.
Deploy using parameters
# Get password from key vault
$secret = Get-AzureKeyVaultSecret -VaultName $VaultName -Name $VaultSecretName
# Create additional parameters that we pass to the template deployment
$additionalParameters = New-Object -TypeName hashtable
$additionalParameters['adminUsername'] = $AdminUsername
$additionalParameters['adminPassword'] = $secret.SecretValue
$result = New-AzureRmResourceGroupDeployment `
-ResourceGroupName $ResourceGroupName `
-TemplateFile $Template `
-TemplateParameterFile $TemplateParameters `
@additionalParameters `
-Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment