Last active
September 26, 2018 06:04
-
-
Save monester/aab133d0521e766361332bbd870ab4fa to your computer and use it in GitHub Desktop.
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
# create service-principal | |
az ad sp create-for-rbac --query "{ client_id: appId, client_secret: password, tenant_id: tenant }" | |
cat >~/.azure/credentials <<EOF | |
# az ad sp create-for-rbac --query "{ client_id: appId, client_secret: password, tenant_id: tenant }" | |
[default] | |
# subscription | |
subscription_id= | |
# tenant | |
tenant= | |
# user credentials | |
client_id= | |
secret= | |
EOF | |
cat cred.json | gawk '(NR>1 && NR<5){s=gensub(/.*"(client_|)(client_id|secret|tenant)(_id|)": "(.*)".*/, "\\2=\\4", "g"); print s}' >> ~/.azure/credentials |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment