Created
September 21, 2022 08:36
-
-
Save MarounMaroun/d1ed3043e4e3fb192a5c313fee27f395 to your computer and use it in GitHub Desktop.
Copy secrets from Azure vault to another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
names=( $(az keyvault secret list --vault-name [oldvault] | jq '.[] | .name') ) | |
for name in "${names[@]}" | |
do | |
name=`echo $name | tr -d '"'` | |
value=`az keyvault secret show --name $name --vault-name [oldvault] | jq '.value' | tr -d '"'` | |
echo "setting $name..." | |
az keyvault secret set --name "$name" --vault-name [newvault] --value "$value" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment