azure-cli: azure-cli-2.46.0.msi and bicep-setup-win-x64.exe already installed, run the command: az bicep install failed

Here is the error messages:

Installing Bicep CLI v0.15.31… The command failed with an unexpected error. Here is the traceback: No section: ‘bicep’ Traceback (most recent call last): File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py”, line 233, in invoke File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py”, line 663, in execute File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py”, line 726, in _run_jobs_serially File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py”, line 697, in _run_job File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py”, line 333, in call File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py”, line 121, in handler File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py”, line 3648, in install_bicep_cli File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py”, line 141, in ensure_bicep_installation File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py”, line 99, in get File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py”, line 94, in get File “D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/config.py”, line 208, in get File “configparser.py”, line 783, in get File “configparser.py”, line 1154, in _unify_values configparser.NoSectionError: No section: ‘bicep’

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az bicep install

Errors:

Paste here the error message you have received. Make sure to remove all sensitive information,
such as user name, password, credential, subscription ID, etc.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az bicep install

Expected Behavior

Environment Summary

Windows-10-10.0.19044-SP0
Python 3.10.10
Installer: MSI

azure-cli 2.46.0

Additional Context

About this issue

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

Most upvoted comments

Hi navba-MSFT, The original message in 29th March mail sent to you is like this: I follow your instruction:

  1. Close all the VS Code windows.
  2. Open the bicep repository in VS Code
  3. Switch from power shell to CMD and type the command, but still got the error. bicep

After the long break and I went back to work today, I thied to represent the error and paste the freashest error via GitHub instead of mail, and the most amazing thing happened: I found it has been OK now! ! when I type the command ‘bicep --version’ in VS Code (just like I did in the picture), now the bicep version show up correctly!

So you could close the case. Thank you very much!