Quick fix for the problem
But it shows the following error on trying to az aks update.
unrecognized arguments: –-enable-cost-analysis
Fix
Install/upgrade the aks-preview extension using the command az extension add --name aks-preview /az extension update --name aks-preview.
After this you might likely have to get another error
Error:
(Bad Request) Preview feature Microsoft.ContainerService/ClusterCostAnalysis not registered.
Fix :
az feature register --namespace Microsoft.ContainerService --name ClusterCostAnalysis
confirm the registration
(az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/ClusterCostAnalysis')].{Name:name,State:properties.state}")
Then rerun the enable-cost-analysis command
az aks update -g <resource-group-name> -n <aks-clustername> --enable-cost-analysis