Skip to content

Instantly share code, notes, and snippets.

@pkirch
Created June 11, 2015 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkirch/72283a0726950c3f7e91 to your computer and use it in GitHub Desktop.
Save pkirch/72283a0726950c3f7e91 to your computer and use it in GitHub Desktop.
Select-AzureSubscription "MSFT MVA Live"
Switch-AzureMode AzureResourceManager
New-AzureResourceGroup –Name mvasqlsvr –Location "West Europe"
New-AzureKeyVault -VaultName mvasqlsvr -ResourceGroupName mvasqlsvr -Location "West Europe" -SKU Premium
$key1 = Add-AzureKeyVaultKey -VaultName mvasqlsvr -Name testkey1 -Destination Software
$securepfxpwd = ConvertTo-SecureString -String "Azureisttoll!" -AsPlainText -Force
$key2 = Add-AzureKeyVaultKey -VaultName mvasqlsvr -Name sqlmasterkey -KeyFilePath C:\Users\pkirch\Desktop\KeyVaultImportTest.pfx -KeyFilePassword $securepfxpwd -Destination HSM
Set-AzureKeyVaultAccessPolicy -VaultName mvasqlsvr -ServicePrincipalName XYZ1 -PermissionsToKeys get,list,wrapKey,unwrapKey,create
Set-AzureKeyVaultAccessPolicy -VaultName mvasqlsvr -ServicePrincipalName XYZ2 -PermissionsToKeys get,list,wrapKey,unwrapKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment