question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az aks list fails in ADO pipeline using 2.41

See original GitHub issue

Describe the bug

Execution of AzureCLI@2 task fails.

Command Name az aks list

Errors:

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'ContainerServiceClientConfiguration' object has no attribute 'api_version'
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/acs/custom.py", line 724, in aks_list
    return _remove_nulls(list(managed_clusters))
  File "/opt/az/lib/python3.10/site-packages/azure/core/paging.py", line 129, in __next__
    return next(self._page_iterator)
  File "/opt/az/lib/python3.10/site-packages/azure/core/paging.py", line 76, in __next__
    self._response = self._get_next(self.continuation_token)
  File "/opt/az/lib/python3.10/site-packages/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py", line 977, in get_next
    request = prepare_request(next_link)
  File "/opt/az/lib/python3.10/site-packages/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py", line 962, in prepare_request
    _next_request_params["api-version"] = self._config.api_version
AttributeError: 'ContainerServiceClientConfiguration' object has no attribute 'api_version'
To open an issue, please run: 'az feedback'

To Reproduce:

  RESOURCE_GROUP=$(az aks list --query "[?name=='${CLUSTER_NAME}'].resourceGroup|[0]" -o tsv)
  • Put any pre-requisite steps here…
  • ``

Expected Behavior

Should return resource group for the specified cluster

Environment Summary


azure-cli 2.41.0

Additional Context

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alan-marcinkowskicommented, Oct 18, 2022

@LyndonP

@alan-marcinkowski There is some progress in #24185 which was created earlier. We are working on getting a fix out for this soon.

…Yes, I’m following it there actually. As mentioned, it’s not an issue for us as we were able to downgrade our ADO agent pool. Thanks.

@alan-marcinkowski Where do you ‘downgrade’ your ADO agent pool? (want to see if this is something I can try on my end)

We have an Azure VMSS used and an ADO agent pool. We use the CustomScript extension to setup the agents in that pool. In that custom script, we used to always install latest / head Azure CLI in that script … but now we install a specific (downgraded) version of Azure CLI.

1reaction
PramodValavala-MSFTcommented, Oct 18, 2022

@alan-marcinkowski Sorry about that. Meant to mention @carlosbustillordguez instead. 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release notes & updates – Azure CLI - Microsoft Learn
Learn about the latest Azure Command-Line Interface (CLI) release notes and updates for both the current and beta versions of the CLI.
Read more >
error while trying creating azure devops pipeline using az cli ...
I am getting the following error when I try to create new pipeline from a pipeline. ERROR: TF400813: The user ...
Read more >
Deploying a multi-container application to Azure Kubernetes ...
Type az aks get-credentials --resource-group yourResourceGroup --name yourAKSname in the command prompt to get the access credentials for the Kubernetes cluster ...
Read more >
Azure Pipelines - Git checkout step fails with cannot lock ref error
error : cannot lock ref 'refs/remotes/origin/<branch>': there is a non-empty directory '.git/refs/remotes/origin/<branch>' blocking reference ...
Read more >
Deploy to Azure Kubernetes (AKS) from Azure DevOps with ...
I'm going to deploy an application to Azure Kubernetes Service ( AKS ) via Azure DevOps using Azure Pipelines from scratch, live!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found