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 "/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/profile/custom.py", line 139, in login
subscriptions = profile.login(
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 159, in login
identity.login_with_service_principal(username, password, scopes=scopes)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 188, in login_with_service_principal
self._service_principal_store.save_entry(entry)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 321, in save_entry
self._load_persistence()
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 350, in _load_persistence
self._entries = self._secret_store.load()
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/decorators.py", line 102, in _wrapped_func
return func(*args, **kwargs)
File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/persistence.py", line 67, in load
return json.loads(self._persistence.load())
File "/opt/az/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/opt/az/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/opt/az/lib/python3.10/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:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
Describe the bug
It seems that an empty body is returned when trying to login as a service principal.
Command Name
az login --service-principal -u $ARM_CLIENT_ID -p $ARM_CLIENT_SECRET --tenant $ARM_TENANT_ID --output none
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az login --service-principal -u {CLIENT_ID} -p {CLIENT_SECRET} --tenant {TENANT_ID} --output none
Expected Behavior
To be logged in as the service principal
Environment Summary
Additional Context