Created
July 24, 2019 10:44
-
-
Save devops-rob/f265531ea50033b44f7572e3df2fc576 to your computer and use it in GitHub Desktop.
Enable and configure azure secrets backend for gashicorp vault
This file contains 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
#!/bin/sh | |
## | |
export AZURE_SUBSCRIPTION_ID= | |
export AZURE_TENANT_ID= | |
export AZURE_CLIENT_ID= | |
export AZURE_CLIENT_SECRET= | |
export ROLE_NAME=spike | |
## | |
vault secrets enable azure | |
vault write azure/config \ | |
subscription_id=$AZURE_SUBSCRIPTION_ID \ | |
tenant_id=$AZURE_TENANT_ID \ | |
client_id=$AZURE_CLIENT_ID \ | |
client_secret=$AZURE_CLIENT_SECRET | |
vault write azure/roles/${ROLE_NAME} ttl=1h azure_roles=-<<EOF | |
[ | |
{ | |
"role_name": "Owner", | |
"scope": "/subscriptions/${AZURE_SUBSCRIPTION_ID}" | |
} | |
] | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment