Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo Deploying a storage account encrypted with a KeyVault key is a two step process
  4. echo because changing the storage settings must happen after the access policy is configured
  5. echo and we are unable to "DependOn" an access policy.
  6. echo This shell script is just an example of how to run the two templates via the Azure CLI
  7.  
  8. read -p 'Resource Group: ' rgName
  9. echo $rgName
  10.  
  11. read -p 'Location (default: Central US): ' resourceLocation
  12. echo "${resourceLocation:=Central US}"
  13.  
  14. read -p 'Storage Name: ' storageName
  15. echo $storageName
  16.  
  17. read -p 'Key Vault Name: ' vaultname
  18. read -p 'Key Name: ' keyname
  19. read -p 'Key Version: ' version
  20.  
  21. echo Verifying Resource Group
  22. az group create --name $rgName --location "$resourceLocation"
  23.  
  24. echo Deploying Storage Account and Creating Access Policy
  25. az group deployment create --resource-group $rgName --template-file storage_step1.json --parameters storageAccountName=$storageName \
  26. keyvaultname=$vaultname
  27.  
  28.  
  29. echo Configuring Storage Account Encryption
  30. az group deployment create --resource-group $rgName --template-file storage_step2.json --parameters storageAccountName=$storageName \
  31. keyvaultname=$vaultname keyname=$keyname keyversion=$version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement