azure-cli: Create AKS cluster fails on 2.4.0

Describe the bug

AKS cluster creation failed after upgrade of az cli from 2.2.0 to 2.4.0

To Reproduce

Run AKS cluster create

az aks create --name gleb-aks-bkp-atom-hero --resource-group cluster-name --node-count 5 --generate-ssh-keys --vm-set-type VirtualMachineScaleSets --enable-addons monitoring --service-principal <service-principal> --client-secret <client-secret> --kubernetes-version 1.14.8 --node-vm-size Standard_DS3_v2

Expected behavior

Cluster gets created

Actual result

The behavior of this command has been altered by the following extension: aks-preview
The request content was invalid and could not be deserialized: 'Could not find member 'template' on object of type 'DeploymentDefinition'. Path 'template', line 1, position 12.'.

Environment summary

OS Linux Ubuntu 18.04 azure-cli 2.4.0

This command does work when az cli version is

2.2.0 *

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

This should be fixed in the latest extension version 0.4.44.

 az extension update --name aks-preview

Please report back if that fixes the issue.

I’ve got this

az aks enable-addons -a monitoring  -g gleb-aks-mangrove-fox -n gleb-aks-mangrove-fox
The behavior of this command has been altered by the following extension: aks-preview
The request content was invalid and could not be deserialized: 'Could not find member 'template' on object of type 'DeploymentDefinition'. Path 'template', line 1, position 12.'.

Fixed in extensions 0.4.60.

The issue below happens when using CLI 2.10.0 so make sure you’re on extension 0.4.60 or above if you plan to use latest cli and work with the monitoring addon.

Getting same error with aks-preview extension 0.4.58 using monitoring addon. Works without aks-preview extension

The request content was invalid and could not be deserialized: 'Could not find member 'template' on object of type 'DeploymentDefinition'. Path 'template', line 1, position 12.'.

cc @marwanad

@marwanad works like a charm. Thanks 😃

Using CLI 2.4.0 cannot create AKS with windows node VM. Command: az aks create --resource-group myResourceGroup1 --name testSCluster1 --node-count 1 monitoring–enable-addons --kubernetes-version 1.17.3 --gener ate-ssh-keys --windows-admin-username azureuser --vm-set-type VirtualMachineScaleSets --node-vm-size Standard_F2s_v2 --network-plugin azure Error: The request content was invalid and could not be deserialized: ‘Could not find member ‘template’ on object of type ‘DeploymentDefinition’. Path ‘template’, line 1, position 12.’.

CLI2.1.0/2.2.0 can deploy it successfully.

I’ve just tried latest on my machine with 0.4.43 and the reslut is the same

@jluk

I know that aks-preview is not quite up to date 0.43, but I’ve used the latest one from

azure-cli                          2.4.0

command-modules-nspkg              2.0.3
core                               2.4.0
nspkg                              3.0.4
telemetry                          1.0.4

Extensions:
aks-preview                       0.4.43

Python location '/opt/az/bin/python3'
Extensions directory '/home/stgleb/.azure/cliextensions'

Python (Linux) 3.6.5 (default, Apr 17 2020, 09:40:29) 
[GCC 7.5.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.