Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo Deploying a storage account encrypted with a KeyVault key is a two step process
- echo because changing the storage settings must happen after the access policy is configured
- echo and we are unable to "DependOn" an access policy.
- echo This shell script is just an example of how to run the two templates via the Azure CLI
- read -p 'Resource Group: ' rgName
- echo $rgName
- read -p 'Location (default: Central US): ' resourceLocation
- echo "${resourceLocation:=Central US}"
- read -p 'Storage Name: ' storageName
- echo $storageName
- read -p 'Key Vault Name: ' vaultname
- read -p 'Key Name: ' keyname
- read -p 'Key Version: ' version
- echo Verifying Resource Group
- az group create --name $rgName --location "$resourceLocation"
- echo Deploying Storage Account and Creating Access Policy
- az group deployment create --resource-group $rgName --template-file storage_step1.json --parameters storageAccountName=$storageName \
- keyvaultname=$vaultname
- echo Configuring Storage Account Encryption
- az group deployment create --resource-group $rgName --template-file storage_step2.json --parameters storageAccountName=$storageName \
- keyvaultname=$vaultname keyname=$keyname keyversion=$version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement