daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Mar 24th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top