Search code examples
cmdcommand-line-interfaceazure-sphere

'azsphere tenant list' command error occurred


To check Azure Sphere tenant list, I used azsphere tenant list command, but an error occurred like below.

>azsphere tenant list --verbose
The command failed with an unexpected error. Here is the traceback:
No section: 'sphere'
Traceback (most recent call last):
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 712, in _run_job
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/cloud_exception_handler.py", line 189, in cloud_exception_handler
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 112, in handler
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/client_factory.py", line 122, in cf_tenants
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/client_factory.py", line 35, in cf_public_api
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/profile.py", line 220, in get_login_credentials
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/config.py", line 144, in get_azsphere_config_value
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/sphere/cli/core/config.py", line 114, in get_global_config_value
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 97, in get
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 92, in get
  File "D:\a\_work\1\s\azsphere-cli\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py", line 206, in get
  File "configparser.py", line 781, in get
  File "configparser.py", line 1149, in _unify_values
configparser.NoSectionError: No section: 'sphere'
To open an issue, please run: 'az feedback'
Command ran in 0.159 seconds (init: 0.008, invoke: 0.151)

I have 3 Azure Sphere tenants.

When I use "Azure Sphere Classic Developer Command Prompt (Deprecated)", it works.

The environment I have been using since before, and it seems that the problem occurred after installing the latest version of the Azure Sphere SDK.

Below is the current SDK version.

>azsphere show-version
 ----------------
 Azure Sphere SDK
 ================
 22.02.3.41775
 ----------------

How can I fix this?


Solution

  • This is a known issue with the 22.02 SDK and will be fixed in the next release. For now, if you login into the CLI (azsphere login), this issue will be resolved.