Skip to content

Instantly share code, notes, and snippets.

@JanneMattila
Created August 25, 2016 13:11
Show Gist options
  • Save JanneMattila/29aca82253994045218275e5079a24f1 to your computer and use it in GitHub Desktop.
Save JanneMattila/29aca82253994045218275e5079a24f1 to your computer and use it in GitHub Desktop.
Clip from deploy-initial.ps1
Write-Host Creating resource group...
New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Location -Verbose
Write-Host Creating key vault...
New-AzureRmKeyVault `
-VaultName $VaultName `
-EnabledForDeployment `
-EnabledForTemplateDeployment `
-ResourceGroupName $ResourceGroupName `
-Location $Location -Verbose
Write-Host Setting access policy to the service principal...
Set-AzureRmKeyVaultAccessPolicy `
-VaultName $VaultName `
-ResourceGroupName $ResourceGroupName `
-PermissionsToSecrets get,set `
-ServicePrincipalName $ServicePrincipal
Write-Host Set admin password to key vault...
Set-AzureKeyVaultSecret `
-SecretValue $AdminPassword `
-VaultName $VaultName `
-Name $VaultSecretName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment