-
-
Save mkol5222/2e48e283c96fd6958583b4c828e09624 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 and note deployment credentials, where relevant | |
SUBSCRIPTION_ID=$(az account list -o json | jq -r '.[]|select(.isDefault)|.id') | |
echo $SUBSCRIPTION_ID | |
# note credentials for config | |
AZCRED=$(az ad sp create-for-rbac --role="Owner" --scopes="/subscriptions/$SUBSCRIPTION_ID") | |
# echo "$AZCRED" | jq . | |
CLIENT_ID=$(echo "$AZCRED" | jq -r .appId) | |
CLIENT_SECRET=$(echo "$AZCRED" | jq -r .password) | |
TENANT_ID=$(echo "$AZCRED" | jq -r .tenant) | |
cat << EOF | |
client_secret = "$CLIENT_SECRET" | |
client_id = "$CLIENT_ID" | |
tenant_id = "$TENANT_ID" | |
subscription_id = "$SUBSCRIPTION_ID" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment