Azure CLI is broken Again

Recently, I wanted to do some work with Azure Kubernetes Service, but unfortunately, the command line tools with Azure CLI yields a traceback when doing anything with AKS. This is not the first time this has happened. This is on macOS, so maybe it works on Linux, I do not know.

UPDATE: A new version of Azure CLI v2.31.0 was recently released and it seems to have fixed the issue. Thank you developers of this project.

The Bug

I usually start with Azure CLI, as this is the most direct route, and should be supported by Azure team. However, after updating, I was surprised to find the tools (Azure CLI v2.30.0) no longer work with AKS:

brew upgrade azure-cli
az login
az aks create \
--resource-group ${AZ_RESOURCE_GROUP} \
--generate-ssh-keys \
--vm-set-type VirtualMachineScaleSets \
--node-vm-size ${AZ_VM_SIZE} \
--load-balancer-sku standard \
--node-count 3 \
--zones 1 2 3

And ka-boom:

I found that other people are experiencing this issue, and is noted in Azure/azure-cli GitHub issues 20644, 20348 , 20269. I tweeted Microsoft Azure about this, but didn’t get much of a response.

Root Cause

Apparently the root cause has to deal with python-tabulate mentioned in python-tabulate/pull/105 and Python 3.10, which is the underlying python targeted used by Azure CLI.

Alternative using Terraform

Azure CLI (az) are essentially python scripts that interact with Azure Resource Manager API. Instead of relying on these tools for infrastructure, you can use Terraform to create a cluster and retrieve the credentials needed for the Kubernetes client CLI (kubectl).


I typically would not write blog on such an error, but just that this has happened before, and I am shocked that the official client tools for Azure cloud can be released into the public with such bugs.

If this was a pure open source tool, then it is up to the community (all of us) to help out the best we can. However, given this is a commercial service, and these are the designated tools to access the service, I hope it is not unreasonable to expect the tools to actually work.

In the mean time, when this happens, you can use either ① the Azure Portal, ② Azure RM API through curl or scripts, or ③ use a configuration tool like Terraform.




Linux NinjaPants Automation Engineering Mutant — exploring DevOps, o11y, k8s, progressive deployment (ci/cd), cloud native infra, infra as code

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Break down Kubernetes Events Internally

Fields and methods for enum values in Dart/Flutter

How our micro frontends help businesses big and small

Web scraping with a proxy pool (the cheap way)

Taking on ‘Distributed systems theory for the distributed systems engineer’

Using Spark on AWS

Docker Image

TestNG Framework and testng.xml:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Joaquín Menchaca (智裕)

Joaquín Menchaca (智裕)

Linux NinjaPants Automation Engineering Mutant — exploring DevOps, o11y, k8s, progressive deployment (ci/cd), cloud native infra, infra as code

More from Medium

Building C++ Projects using Azure Pipelines and Azure Artifacts

Azure Kubernetes (AKS) Events with Azure Log Analytics

Self-hosted Linux Agent on Azure DevOps in 5 minutes!!

Foundations in Azure DevOps YAML pipelines