0

while connecting with Azure kubernetes cluster from windows via powershell, I am getting an error.

The command being used is -

az aks get-credentials --name clustername --resource-group rgname --subscription subsId

The command failed with an unexpected error. Here is the traceback:

'name'
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\knack\knack\cli.py", line 206, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli-core\azure\cli\core\commands\__init__.py", line 578, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli-core\azure\cli\core\commands\__init__.py", line 636, in _run_jobs_serially
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli-core\azure\cli\core\commands\__init__.py", line 629, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\six\six.py", line 693, in reraise
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli-core\azure\cli\core\commands\__init__.py", line 606, in _run_job
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli-core\azure\cli\core\commands\__init__.py", line 305, in __call__
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli-core\azure\cli\core\__init__.py", line 485, in default_command_handler
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli\azure\cli\command_modules\acs\custom.py", line 1693, in aks_get_credentials
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli\azure\cli\command_modules\acs\custom.py", line 2422, in _print_or_merge_credentials
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli\azure\cli\command_modules\acs\custom.py", line 1063, in merge_kubernetes_configurations
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-qdpilz60\azure-cli\azure\cli\command_modules\acs\custom.py", line 1012, in _handle_merge
KeyError: 'name'
4
  • I guess the problem is your Azure CLI. You can try to reinstall the CLI or update it. Then try again. Commented Jul 25, 2019 at 2:45
  • yep, I'd start there. it works perfectly fine for me Commented Jul 25, 2019 at 6:28
  • Any more update for the question? Do you try the advice in the comment? Commented Jul 26, 2019 at 9:00
  • I tried reinstalling but that didn't help, the same error prompted again Commented Jul 28, 2019 at 5:40

1 Answer 1

1

This error happens when your ~/.kube/config is structured differently than what az aks get-credentials expects, for example when certain keys are missing. See https://github.com/Azure/azure-cli/issues/10812

You can resolve this issue by deleting ~/.kube/config.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah I got that sorted long time ago.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.