Created
August 23, 2022 22:13
-
-
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.
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
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