Skip to content

Instantly share code, notes, and snippets.

@StianOvrevage
Last active March 19, 2020 11:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StianOvrevage/f9575c41acbefd6bac8ae2862201f5cd to your computer and use it in GitHub Desktop.
Save StianOvrevage/f9575c41acbefd6bac8ae2862201f5cd to your computer and use it in GitHub Desktop.
Get all AKS credentials with jq

Get AKS credentials for all clusters on current subscription:

bash <(az aks list | jq -r '.[] | "az aks get-credentials --overwrite-existing --admin --resource-group \(.resourceGroup|@sh) --name \(.name|@sh)"')

To list and change subscriptions, use:

az account list --output table
az account set --subscription "MySub"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment