azure-cli: az aks check-acr error: The azure auth plugin has been removed.

Related command

az aks check-acr

Describe the bug

When executing the command, within the Cloud Shell, I get following error:

error: The azure auth plugin has been removed.
Please use the https://github.com/Azure/kubelogin kubectl/client-go credential plugin instead.
See https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins for further details
The command failed with an unexpected error. Here is the traceback:
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/acs/custom.py", line 1319, in aks_check_acr
    kubectl_version = json.loads(jsonS)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

To Reproduce

  1. Open cloud shell (Bash)
  2. Run following commands:
az account set --subscription $SUBSCRIPTION
az aks get-credentials -g $CLUSTER_RGR -n $CLUSTER
az aks check-acr --name $CLUSTER  --resource-group $CLUSTER_RGR --acr myacr.azurecr.io

Expected behavior

I expect the command to work, and not give this error.

Environment summary

Cloud shell:

azure-cli                         2.44.1

core                              2.44.1
telemetry                          1.0.8

Extensions:
ai-examples                        0.2.5
ml                                2.12.1
ssh                                1.1.3

Dependencies:
msal                              1.20.0
azure-mgmt-resource             21.1.0b1

Python location '/usr/bin/python3.9'
Extensions directory '/home/hans/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Dec 15 2022, 01:12:13) 
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.```

**Additional context**
<!--- Add any other context about the problem here. --->

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

Hi team! I also have the same update with the same environment. Any updates?

@Styxxy We are looking into it and get back to you for any additional information.

Seems like cloud shell has been updated to kubectl 1.26.1 and now it works. Tested it locally with latest 1.26.1 kubectl and it works.

Note: the download link on the kubernetes website still refers to 1.26.0 (https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/). You can download the specific version from https://dl.k8s.io/release/v1.26.1/bin/windows/amd64/kubectl.exe .