az aks list fails in ADO pipeline using 2.41
See original GitHub issueDescribe 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:
- Created a year ago
- Reactions:1
- Comments:13 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@LyndonP
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.
@alan-marcinkowski Sorry about that. Meant to mention @carlosbustillordguez instead. 😅