Skip to content

Instantly share code, notes, and snippets.

@DarqueWarrior
Created August 23, 2022 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarqueWarrior/0eb3566446da2823e43beaa78a203791 to your computer and use it in GitHub Desktop.
Save DarqueWarrior/0eb3566446da2823e43beaa78a203791 to your computer and use it in GitHub Desktop.
PowerShell Snippet: Using the Azure CLI to find the latest supported K8s version in a location. I use this to pass to my Bicep files to create an AKS with the latest version.
Write-Output 'Finding version of K8s'
$location = 'eastus'
# Use index -1 to get the last entry which should be
# the latest version
$k8sversion = $(az aks get-versions --location $location `
--query orchestrators[-1].orchestratorVersion `
--output tsv)
Write-Verbose "k8s version = $k8sversion"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment