azure-cli: az aks get-credentials not returning access-profile

I am using Azure-CLI version 2.0.24, however az aks get-credentials is not working.

I am getting the following error:

‘ManagedCluster’ object has no attribute ‘properties’ Traceback (most recent call last): File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/knack/cli.py”, line 193, in invoke cmd_result = self.invocation.execute(args) File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/commands/init.py”, line 319, in execute six.reraise(*sys.exc_info()) File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/commands/init.py”, line 292, in execute result = cmd(params) File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/commands/init.py”, line 169, in call return super(AzCliCommand, self).call(*args, **kwargs) File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/knack/commands.py”, line 109, in call return self.handler(*args, **kwargs) File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/core/init.py”, line 328, in default_command_handler result = op(**command_args) File “/home/xiou/lib/azure-cli/local/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py”, line 1329, in aks_get_credentials access_profiles = mc.properties.access_profiles AttributeError: ‘ManagedCluster’ object has no attribute ‘properties’

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 27
  • Comments: 52 (12 by maintainers)

Most upvoted comments

Hello Microsoft! This is prevents a lot of people of using managed AKS Kubernetes! Any workaround is appreciated!

I am just seeing something similar, just started happening:

az aks get-credentials -n cluster-name -g rg-name No Kubernetes access profiles found. Cluster provisioning state is “Succeeded”.

Edit:

that was with 2.0.22 After updating to 2.0.24 I get the stack trace like the OP.

2.0.23 works. Reverted with: apt-get install azure-cli=2.0.23-1

Rollback to 2.0.23 with homebrew on MacOSX:

brew unlink azure-cli //if already installed

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/d8a64440c3944f1dfde4f1bb228d7218868c636f/Formula/azure-cli.rb // Commit of 2.023 formula

Same problem here with Ubuntu and azure-cli 2.0.24-1:

‘ManagedCluster’ object has no attribute ‘properties’ Traceback (most recent call last): File “/opt/az/lib/python3.6/site-packages/knack/cli.py”, line 193, in invoke cmd_result = self.invocation.execute(args) File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 319, in execute six.reraise(*sys.exc_info()) File “/opt/az/lib/python3.6/site-packages/six.py”, line 693, in reraise raise value File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 292, in execute result = cmd(params) File “/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py”, line 169, in call return super(AzCliCommand, self).call(*args, **kwargs) File “/opt/az/lib/python3.6/site-packages/knack/commands.py”, line 109, in call return self.handler(*args, **kwargs) File “/opt/az/lib/python3.6/site-packages/azure/cli/core/init.py”, line 328, in default_command_handler result = op(**command_args) File “/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py”, line 1329, in aks_get_credentials access_profiles = mc.properties.access_profiles AttributeError: ‘ManagedCluster’ object has no attribute ‘properties’

After downgrading to azure-cli 2.0.23-1 with command sudo apt-get install azure-cli=2.0.23-1 it works fine.

2.0.25 has been released which should include this fix.

@benc-uk just make sure you use 2.0.23 and everything will work 😃. If you have .24 now then downgrade it to .23.

It appears that some CLI changes in #5086 were lost in this release? We’re working on a fix, but for the time being I think the only workaround is to use the previous 2.0.23 release.

This looks like an issue with the Azure CLI. I downloaded v2.0.23 from https://azurecliprod.blob.core.windows.net/msi/azure-cli-2.0.23.msi and was able to login to the aks cluster.

Alternatively you can also try logging in from the Azure CloudShell Bash.

Confirmed working with 2.0.25 on Mac OS X too.

Can confirm 2.0.25 fixes the issue